Skip to content

Commit 2080618

Browse files
authored
Merge branch 'master' into improved
2 parents b69f9af + 23769fa commit 2080618

File tree

10 files changed

+135
-157
lines changed

10 files changed

+135
-157
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build, Test, Publish
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
env:
14+
OWNER: "FModel"
15+
16+
jobs:
17+
build-test-publish:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v6
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v5
23+
with:
24+
dotnet-version: 10.0.x
25+
26+
- name: Restore dependencies
27+
run: dotnet restore
28+
29+
- name: Build
30+
run: dotnet build -c Release --no-restore
31+
32+
- name: Run Tests
33+
run: dotnet test -c Release --no-restore --no-build -v normal
34+
35+
- name: Pack NuGet Package(s)
36+
run: dotnet pack -c Release --no-restore --no-build --output "${{ github.workspace }}/nuget-packages"
37+
38+
- name: Push NuGet Package(s) to nuget.org
39+
run: |
40+
dotnet nuget push "${{ github.workspace }}/nuget-packages/*.nupkg" \
41+
--source https://api.nuget.org/v3/index.json \
42+
--api-key ${{ secrets.NUGET_API_KEY }} \
43+
--skip-duplicate
44+
45+
- name: Add GitHub Packages source
46+
run: |
47+
dotnet nuget add source \
48+
--username ${{ github.actor }} \
49+
--password ${{ secrets.GITHUB_TOKEN }} \
50+
--store-password-in-clear-text \
51+
--name github \
52+
"https://nuget.pkg.github.com/${{ env.OWNER }}/index.json"
53+
54+
- name: Push NuGet Package(s) to GitHub
55+
run: |
56+
dotnet nuget push "${{ github.workspace }}/nuget-packages/*.nupkg" \
57+
--source github \
58+
--api-key ${{ secrets.GITHUB_TOKEN }} \
59+
--skip-duplicate

.github/workflows/default.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

BankExtractor/BankExtractor.csproj

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<IsPackable>false</IsPackable>
9+
</PropertyGroup>
910

10-
<ItemGroup>
11-
<ProjectReference Include="..\Fmod5Sharp\Fmod5Sharp.csproj" />
12-
</ItemGroup>
11+
<ItemGroup>
12+
<ProjectReference Include="..\Fmod5Sharp\Fmod5Sharp.csproj" />
13+
</ItemGroup>
1314

1415
</Project>
Lines changed: 44 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,48 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
7-
<IsPackable>false</IsPackable>
8-
9-
<Configurations>Release;Debug</Configurations>
10-
11-
<Platforms>AnyCPU;x64</Platforms>
12-
</PropertyGroup>
13-
14-
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
15-
<PlatformTarget>x86</PlatformTarget>
16-
</PropertyGroup>
17-
18-
<ItemGroup>
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
20-
<PackageReference Include="xunit" Version="2.4.1" />
21-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
22-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
23-
<PrivateAssets>all</PrivateAssets>
24-
</PackageReference>
25-
<PackageReference Include="coverlet.collector" Version="3.0.2">
26-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
27-
<PrivateAssets>all</PrivateAssets>
28-
</PackageReference>
29-
</ItemGroup>
30-
31-
<ItemGroup>
32-
<ProjectReference Include="..\Fmod5Sharp\Fmod5Sharp.csproj" />
33-
</ItemGroup>
34-
35-
<ItemGroup>
36-
<None Remove="TestResources\short_vorbis.fsb" />
37-
<EmbeddedResource Include="TestResources\short_vorbis.fsb" />
38-
<None Remove="TestResources\long_vorbis.fsb" />
39-
<EmbeddedResource Include="TestResources\long_vorbis.fsb" />
40-
<None Remove="TestResources\pcm16.fsb" />
41-
<EmbeddedResource Include="TestResources\pcm16.fsb" />
42-
<None Remove="TestResources\gcadpcm.fsb" />
43-
<EmbeddedResource Include="TestResources\gcadpcm.fsb" />
44-
<None Remove="TestResources\imaadpcm_short.fsb" />
45-
<EmbeddedResource Include="TestResources\imaadpcm_short.fsb" />
46-
<None Remove="TestResources\imaadpcm_long.fsb" />
47-
<EmbeddedResource Include="TestResources\imaadpcm_long.fsb" />
48-
<None Remove="TestResources\broken_imaad.fsb" />
49-
<None Remove="TestResources\previously_unrecoverable_vorbis.fsb" />
50-
<EmbeddedResource Include="TestResources\previously_unrecoverable_vorbis.fsb" />
51-
<None Remove="TestResources\xbox_imaad.fsb" />
52-
<EmbeddedResource Include="TestResources\xbox_imaad.fsb" />
53-
<None Remove="TestResources\vorbis_with_blockflag_exception.fsb" />
54-
<EmbeddedResource Include="TestResources\vorbis_with_blockflag_exception.fsb" />
55-
</ItemGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
11+
<PackageReference Include="xunit" Version="2.9.3" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
13+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
14+
<PrivateAssets>all</PrivateAssets>
15+
</PackageReference>
16+
<PackageReference Include="coverlet.collector" Version="6.0.4">
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
<PrivateAssets>all</PrivateAssets>
19+
</PackageReference>
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<ProjectReference Include="..\Fmod5Sharp\Fmod5Sharp.csproj" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<None Remove="TestResources\short_vorbis.fsb" />
28+
<EmbeddedResource Include="TestResources\short_vorbis.fsb" />
29+
<None Remove="TestResources\long_vorbis.fsb" />
30+
<EmbeddedResource Include="TestResources\long_vorbis.fsb" />
31+
<None Remove="TestResources\pcm16.fsb" />
32+
<EmbeddedResource Include="TestResources\pcm16.fsb" />
33+
<None Remove="TestResources\gcadpcm.fsb" />
34+
<EmbeddedResource Include="TestResources\gcadpcm.fsb" />
35+
<None Remove="TestResources\imaadpcm_short.fsb" />
36+
<EmbeddedResource Include="TestResources\imaadpcm_short.fsb" />
37+
<None Remove="TestResources\imaadpcm_long.fsb" />
38+
<EmbeddedResource Include="TestResources\imaadpcm_long.fsb" />
39+
<None Remove="TestResources\broken_imaad.fsb" />
40+
<None Remove="TestResources\previously_unrecoverable_vorbis.fsb" />
41+
<EmbeddedResource Include="TestResources\previously_unrecoverable_vorbis.fsb" />
42+
<None Remove="TestResources\xbox_imaad.fsb" />
43+
<EmbeddedResource Include="TestResources\xbox_imaad.fsb" />
44+
<None Remove="TestResources\vorbis_with_blockflag_exception.fsb" />
45+
<EmbeddedResource Include="TestResources\vorbis_with_blockflag_exception.fsb" />
46+
</ItemGroup>
5647

5748
</Project>

Fmod5Sharp.sln

Lines changed: 0 additions & 50 deletions
This file was deleted.

Fmod5Sharp.slnx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path=".github/workflows/build-test-publish.yml" />
4+
<File Path=".gitignore" />
5+
<File Path="README.md" />
6+
</Folder>
7+
<Project Path="BankExtractor/BankExtractor.csproj" />
8+
<Project Path="Fmod5Sharp.Tests/Fmod5Sharp.Tests.csproj" />
9+
<Project Path="Fmod5Sharp/Fmod5Sharp.csproj" />
10+
<Project Path="HeaderGenerator/HeaderGenerator.csproj" />
11+
</Solution>

Fmod5Sharp/CodecRebuilders/FmodVorbisRebuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private static void ReadSamplePackets(BinaryReader inputReader, out List<int> pa
176176
{
177177
var packetSize = inputReader.ReadUInt16();
178178

179-
if (packetSize == 0)
179+
if (packetSize == 0 || packetSize == 0xFFFF)
180180
break; //EOS
181181

182182
packetLengths.Add(packetSize);

Fmod5Sharp/Fmod5Sharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
6-
<Nullable>enable</Nullable>
7-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<IsPackable>false</IsPackable>
8+
</PropertyGroup>
89

910
</Project>

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Fmod5Sharp
22
## Managed decoder for FMOD 5 sound banks (FSB files).
33

4-
[![NuGet](https://img.shields.io/nuget/v/Fmod5Sharp?)](https://www.nuget.org/packages/Fmod5Sharp/)
4+
[![NuGet](https://img.shields.io/nuget/v/FModel.Fmod5Sharp?)](https://www.nuget.org/packages/FModel.Fmod5Sharp/)
55

66
This library allows you to read FMOD 5 sound bank files (they start with the characters FSB5) into their contained samples,
77
and then export those samples to standard file formats (assuming the contained data format is supported).
@@ -78,6 +78,3 @@ This project uses:
7878
- [OggVorbisEncoder](https://github.com/SteveLillis/.NET-Ogg-Vorbis-Encoder) to build Ogg Vorbis output streams.
7979
- [NAudio.Core](https://github.com/naudio/NAudio) to do the same thing but for WAV files.
8080
- [BitStreams](https://github.com/rubendal/BitStream) for parsing vorbis header data.
81-
- [IndexRange](https://github.com/bgrainger/IndexRange) to make my life easier when supporting .NET Standard 2.0.
82-
83-
It also uses System.Text.Json.

0 commit comments

Comments
 (0)