diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index b02352418..a91365014 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -7,7 +7,7 @@ on: jobs: build: runs-on: ubuntu-latest - container: mcr.microsoft.com/dotnet/sdk:7.0 + container: mcr.microsoft.com/dotnet/sdk:8.0 steps: - uses: actions/checkout@v3 @@ -46,7 +46,7 @@ jobs: publish-nuget: needs: build runs-on: ubuntu-latest - container: mcr.microsoft.com/dotnet/sdk:7.0 + container: mcr.microsoft.com/dotnet/sdk:8.0 steps: - uses: actions/checkout@master - name: Publish to NuGet diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index dfc52e13a..19a8e9483 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -9,7 +9,7 @@ on: jobs: build: runs-on: ubuntu-latest - container: mcr.microsoft.com/dotnet/sdk:7.0 + container: mcr.microsoft.com/dotnet/sdk:8.0 steps: - uses: actions/checkout@v3 diff --git a/src/SoundFingerprinting.Tests/Integration/IntegrationWithSampleFilesTest.cs b/src/SoundFingerprinting.Tests/Integration/IntegrationWithSampleFilesTest.cs index 9cc40396c..f829e0e6e 100644 --- a/src/SoundFingerprinting.Tests/Integration/IntegrationWithSampleFilesTest.cs +++ b/src/SoundFingerprinting.Tests/Integration/IntegrationWithSampleFilesTest.cs @@ -7,12 +7,13 @@ using Audio; using Data; + using ProtoBuf; using NUnit.Framework; public abstract class IntegrationWithSampleFilesTest : AbstractTest { - private readonly string pathToSamples = Path.Combine(TestContext.CurrentContext.TestDirectory, "chopinsamples.bin"); + protected readonly string pathToSamples = Path.Combine(TestContext.CurrentContext.TestDirectory, "chopinsamples.bin"); protected readonly string PathToWav = Path.Combine(TestContext.CurrentContext.TestDirectory, "chopin_short.wav"); @@ -56,11 +57,8 @@ protected AudioSamples GetAudioSamples() { lock (this) { - var serializer = new BinaryFormatter(); using Stream stream = new FileStream(pathToSamples, FileMode.Open, FileAccess.Read); -#pragma warning disable SYSLIB0011 - return (AudioSamples)serializer.Deserialize(stream); -#pragma warning restore SYSLIB0011 + return Serializer.DeserializeWithLengthPrefix(stream, PrefixStyle.Fixed32); } } diff --git a/src/SoundFingerprinting.Tests/Properties/AssemblyInfo.cs b/src/SoundFingerprinting.Tests/Properties/AssemblyInfo.cs index 7f68a6409..5e29710a4 100644 --- a/src/SoundFingerprinting.Tests/Properties/AssemblyInfo.cs +++ b/src/SoundFingerprinting.Tests/Properties/AssemblyInfo.cs @@ -11,5 +11,5 @@ [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("4cac962e-ebc5-4006-a1e0-7ffb3e2483c2")] -[assembly: AssemblyVersion("8.30.0.100")] -[assembly: AssemblyInformationalVersion("8.30.0.100")] +[assembly: AssemblyVersion("9.0.0.100")] +[assembly: AssemblyInformationalVersion("9.0.0.100")] diff --git a/src/SoundFingerprinting.Tests/SoundFingerprinting.Tests.csproj b/src/SoundFingerprinting.Tests/SoundFingerprinting.Tests.csproj index 6c9fabe2e..8b91ae05b 100644 --- a/src/SoundFingerprinting.Tests/SoundFingerprinting.Tests.csproj +++ b/src/SoundFingerprinting.Tests/SoundFingerprinting.Tests.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 true false latest @@ -8,8 +8,8 @@ - - + + diff --git a/src/SoundFingerprinting.Tests/TestEnvironment/chopinsamples.bin b/src/SoundFingerprinting.Tests/TestEnvironment/chopinsamples.bin index 40d94ab9a..2645da9ca 100644 Binary files a/src/SoundFingerprinting.Tests/TestEnvironment/chopinsamples.bin and b/src/SoundFingerprinting.Tests/TestEnvironment/chopinsamples.bin differ diff --git a/src/SoundFingerprinting/Audio/AudioSamples.cs b/src/SoundFingerprinting/Audio/AudioSamples.cs index 003d7c421..6915871c3 100644 --- a/src/SoundFingerprinting/Audio/AudioSamples.cs +++ b/src/SoundFingerprinting/Audio/AudioSamples.cs @@ -1,12 +1,14 @@ namespace SoundFingerprinting.Audio { using System; + using ProtoBuf; using SoundFingerprinting.Command; /// /// Audio samples that can be used for fingerprinting. /// [Serializable] + [ProtoContract] public class AudioSamples { /// @@ -45,21 +47,25 @@ private AudioSamples() /// /// Gets audio samples in Ieee32 format. /// + [ProtoMember(1)] public float[] Samples { get; } /// /// Gets the origin of the audio samples. /// + [ProtoMember(2)] public string Origin { get; } /// /// Gets sample rate at which the audio has been sampled. /// + [ProtoMember(3)] public int SampleRate { get; } /// /// Gets relative to time location when the audio samples have been generated. /// + [ProtoMember(4)] public DateTime RelativeTo { get; } /// @@ -68,6 +74,7 @@ private AudioSamples() /// /// Measured in seconds, used only on hashes generated by . /// + [ProtoMember(5)] public double TimeOffset { get; } /// diff --git a/src/SoundFingerprinting/Math/SimilarityUtility.cs b/src/SoundFingerprinting/Math/SimilarityUtility.cs index a9c835823..356c38486 100644 --- a/src/SoundFingerprinting/Math/SimilarityUtility.cs +++ b/src/SoundFingerprinting/Math/SimilarityUtility.cs @@ -61,7 +61,7 @@ public double CalculateJacquardSimilarity(bool[] x, bool[] y) // 1 1 a++; } - else if (x[i] | y[i]) + else if (x[i] || y[i]) { // 1 0 || 0 1 b++; diff --git a/src/SoundFingerprinting/Properties/AssemblyInfo.cs b/src/SoundFingerprinting/Properties/AssemblyInfo.cs index 832cbcafc..fdcc991d9 100644 --- a/src/SoundFingerprinting/Properties/AssemblyInfo.cs +++ b/src/SoundFingerprinting/Properties/AssemblyInfo.cs @@ -19,5 +19,5 @@ [assembly: InternalsVisibleTo("SoundFingerprinting.FFT.FFTW")] [assembly: InternalsVisibleTo("SoundFingerprinting.FFT.FFTW.Tests")] -[assembly: AssemblyVersion("8.30.0.100")] -[assembly: AssemblyInformationalVersion("8.30.0.100")] +[assembly: AssemblyVersion("9.0.0.100")] +[assembly: AssemblyInformationalVersion("9.0.0.100")] diff --git a/src/SoundFingerprinting/SoundFingerprinting.csproj b/src/SoundFingerprinting/SoundFingerprinting.csproj index bc6180686..496474d43 100644 --- a/src/SoundFingerprinting/SoundFingerprinting.csproj +++ b/src/SoundFingerprinting/SoundFingerprinting.csproj @@ -4,14 +4,14 @@ true false enable - 8.30.0 + 9.0.0-alpha Sergiu Ciumac SoundFingerprinting is a C# framework that implements an efficient algorithm of audio fingerprinting and identification. Designed for developers, enthusiasts, researchers in the fields of audio processing, data mining, digital signal processing. https://github.com/addictedcs/soundfingerprinting https://github.com/AddictedCS/soundfingerprinting git - Version bump to v8.30.0 accomodating SoundFingerprinting.Emy version upgrade. + Upgrading to .NET 8 dependencies. Audio Video Identification Fingerprinting Digital Signal Processing Music Recognition Data Mining Content Sound Shazam latest @@ -29,7 +29,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -37,12 +37,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - +