Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  Upgrading to .NET 8
  Fix typo in Jacquard similarity calculation
  • Loading branch information
AddictedCS committed Nov 19, 2023
2 parents 626dde5 + 28f16da commit ec64954
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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<AudioSamples>(stream, PrefixStyle.Fixed32);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/SoundFingerprinting.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.5" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Binary file modified src/SoundFingerprinting.Tests/TestEnvironment/chopinsamples.bin
Binary file not shown.
7 changes: 7 additions & 0 deletions src/SoundFingerprinting/Audio/AudioSamples.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
namespace SoundFingerprinting.Audio
{
using System;
using ProtoBuf;
using SoundFingerprinting.Command;

/// <summary>
/// Audio samples that can be used for fingerprinting.
/// </summary>
[Serializable]
[ProtoContract]
public class AudioSamples
{
/// <summary>
Expand Down Expand Up @@ -45,21 +47,25 @@ private AudioSamples()
/// <summary>
/// Gets audio samples in Ieee32 format.
/// </summary>
[ProtoMember(1)]
public float[] Samples { get; }

/// <summary>
/// Gets the origin of the audio samples.
/// </summary>
[ProtoMember(2)]
public string Origin { get; }

/// <summary>
/// Gets sample rate at which the audio has been sampled.
/// </summary>
[ProtoMember(3)]
public int SampleRate { get; }

/// <summary>
/// Gets relative to time location when the audio samples have been generated.
/// </summary>
[ProtoMember(4)]
public DateTime RelativeTo { get; }

/// <summary>
Expand All @@ -68,6 +74,7 @@ private AudioSamples()
/// <remarks>
/// Measured in seconds, used only on hashes generated by <see cref="RealtimeQueryCommand"/>.
/// </remarks>
[ProtoMember(5)]
public double TimeOffset { get; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/SoundFingerprinting/Math/SimilarityUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
4 changes: 2 additions & 2 deletions src/SoundFingerprinting/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
10 changes: 5 additions & 5 deletions src/SoundFingerprinting/SoundFingerprinting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Nullable>enable</Nullable>
<PackageVersion>8.30.0</PackageVersion>
<PackageVersion>9.0.0-alpha</PackageVersion>
<Authors>Sergiu Ciumac</Authors>
<PackageDescription>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.</PackageDescription>
<PackageProjectUrl>https://github.com/addictedcs/soundfingerprinting</PackageProjectUrl>
<RepositoryUrl>https://github.com/AddictedCS/soundfingerprinting</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReleaseNotes>
Version bump to v8.30.0 accomodating SoundFingerprinting.Emy version upgrade.
Upgrading to .NET 8 dependencies.
</PackageReleaseNotes>
<PackageTags>Audio Video Identification Fingerprinting Digital Signal Processing Music Recognition Data Mining Content Sound Shazam</PackageTags>
<LangVersion>latest</LangVersion>
Expand All @@ -29,20 +29,20 @@
<Copy SourceFiles="@(DocFile)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="false" />
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<AdditionalFiles Include="../stylecop.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="protobuf-net" Version="2.4.6" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit ec64954

Please sign in to comment.