SoundFingerprinting 11.2.0
dotnet add package SoundFingerprinting --version 11.2.0
NuGet\Install-Package SoundFingerprinting -Version 11.2.0
<PackageReference Include="SoundFingerprinting" Version="11.2.0" />
paket add SoundFingerprinting --version 11.2.0
#r "nuget: SoundFingerprinting, 11.2.0"
// Install SoundFingerprinting as a Cake Addin #addin nuget:?package=SoundFingerprinting&version=11.2.0 // Install SoundFingerprinting as a Cake Tool #tool nuget:?package=SoundFingerprinting&version=11.2.0
Audio/Video fingerprinting and recognition in .NET
soundfingerprinting is a C# framework designed for companies, enthusiasts, researchers in the fields of digital signal processing, data mining and audio/video recognition. It implements an efficient algorithm which provides fast insert and retrieval of acoustic and video fingerprints with high precision and recall rate.
Documentation
Full documentation is available on the Wiki page.
Below code snippet shows how to extract acoustic fingerprints from an audio file and later use them as identifiers to recognize unknown audio query. These fingerprints will be stored in a configurable datastore.
private readonly IModelService modelService = new InMemoryModelService(); // store fingerprints in RAM
private readonly IAudioService audioService = new SoundFingerprintingAudioService(); // default audio library
public async Task StoreForLaterRetrieval(string file)
{
var track = new TrackInfo("GBBKS1200164", "Skyfall", "Adele");
// create fingerprints
var avHashes = await FingerprintCommandBuilder.Instance
.BuildFingerprintCommand()
.From(file)
.UsingServices(audioService)
.Hash();
// store hashes in the database for later retrieval
modelService.Insert(track, avHashes);
}
Querying
Once you've inserted the fingerprints into the datastore, later you might want to query the storage in order to recognize the song those samples you have. The origin of query samples may vary: file, URL, microphone, radio tuner, etc. It's up to your application, where you get the samples from.
public async Task<TrackData> GetBestMatchForSong(string file)
{
int secondsToAnalyze = 10; // number of seconds to analyze from query file
int startAtSecond = 0; // start at the begining
// query the underlying database for similar audio sub-fingerprints
var queryResult = await QueryCommandBuilder.Instance.BuildQueryCommand()
.From(file, secondsToAnalyze, startAtSecond)
.UsingServices(modelService, audioService)
.Query();
return queryResult.BestMatch.Track;
}
Fingerprints Storage
The default storage, which comes bundled with soundfingerprinting NuGet package, is a plain in-memory storage, available via <code>InMemoryModelService</code> class. If you plan to use an external persistent storage for fingerprints Emy is the preferred choice. Emy provides a community version which is free for non-commercial use. More about Emy can be found on wiki page.
Supported audio/video formats
Read Supported Media Formats page for details about processing different file formats or realtime streams.
Video fingerprinting support since version 8.0.0
Since v8.0.0
video fingerprinting support has been added. Similarly to audio fingerprinting, video fingerprints are generated from video frames, and used to insert and later query the datastore for exact and similar matches. You can use SoundFingerprinting
to fingerprint either audio or video content or both at the same time. More details about video fingerprinting are available here.
Version Matrix
If you are using FFmpegAudioService
as described in the wiki, follow the below version matrix.
| SoundFingerprinting | SoundFingerprinting.Emy | FFmpeg |
| ---- | ------ |-----|
| 8.x | 8.x | 4.x |
| 9.x | 9.x | 5.x |
| 10.x | 10.x | 6.x |
FAQ
- Can I apply this algorithm for speech recognition purposes?
No. The granularity of one fingerprint is roughly ~1.46 seconds.
- Can the algorithm detect exact query position in resulted track?
Yes.
- Can I use SoundFingerprinting to detect ads in radio streams?
Yes. Actually this is the most frequent use-case where SoundFingerprinting was successfully used.
- How many tracks can I store in
InMemoryModelService
?
100 hours of content with
DefaultFingerprintingConfiguration
will consume ~5GB of RAM.
Get it on NuGet
Install-Package SoundFingerprinting
How it works
Demo
My description of the algorithm alogside with the demo project can be found on CodeProject. The article is from 2011, and may be outdated. The demo project is a Audio File Duplicates Detector. Its latest source code can be found here. Its a WPF MVVM project that uses the algorithm to detect what files are perceptually very similar.
Contribute
If you want to contribute you are welcome to open issues or discuss on issues page. Feel free to contact me for any remarks, ideas, bug reports etc.
License
The framework is provided under MIT license agreement.
© Soundfingerprinting, 2010-2024, sergiu@emysound.com
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- protobuf-net (>= 2.4.6)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on SoundFingerprinting:
Package | Downloads |
---|---|
SoundFingerprinting.Emy
SoundFingerprinting.Emy is a native C# client for Emy fingerprints storage. It provides ways to insert, query, delete entries from Emy. To learn more about SoundFingerprinting visit github page https://github.com/AddictedCS/soundfingerprinting. To learn more about Emy visit https://www.emysound.com |
|
SoundFingerprinting.Audio.Bass
Un4seen.Bass extension library for SoundFingerprinting framework. SoundFingerprinting default library is designed to read only raw wave files. This extension provides the ability to read all files supported by Bass (including .mp3, .flac, .ogg). Un4seen.Bass is free for non-comercial use. If you intend to use this extension for commercial purposes, please contact http://www.un4seen.com for licensing |
|
SoundFingerprinting.Audio.NAudio
NAudio extension library for SoundFingerprinting framework. This extension provides the ability to read all files supported by NAudio media foundation framework. Since NAudio depends on Windows native calls, this extension can execute only in Windows environment. |
|
SoundFingerprinting.Solr
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. |
|
SoundFingerprinting.SQL
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. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on SoundFingerprinting:
Repository | Stars |
---|---|
cjmanca/plex-credits-detect
Augments plex's built in intro detection, additionally detecting credits.
|
Version | Downloads | Last updated |
---|---|---|
11.2.0 | 177 | 12/19/2024 |
11.1.0 | 722 | 10/29/2024 |
11.0.0 | 330 | 10/3/2024 |
10.7.0 | 722 | 8/8/2024 |
10.6.0 | 262 | 7/9/2024 |
10.4.0 | 335 | 6/5/2024 |
10.3.1 | 275 | 5/17/2024 |
10.3.0 | 143 | 5/16/2024 |
10.0.0 | 854 | 4/5/2024 |
9.5.0 | 220 | 3/27/2024 |
9.4.4 | 867 | 3/2/2024 |
9.4.2 | 404 | 2/27/2024 |
9.4.0 | 312 | 2/26/2024 |
9.4.0-beta1 | 115 | 2/23/2024 |
9.3.0 | 352 | 2/19/2024 |
9.2.0 | 381 | 2/6/2024 |
9.1.0 | 1,037 | 12/28/2023 |
9.0.0 | 1,030 | 11/30/2023 |
9.0.0-beta | 580 | 11/22/2023 |
9.0.0-alpha | 117 | 11/19/2023 |
8.33.0 | 448 | 12/28/2023 |
8.32.0 | 172 | 11/21/2023 |
8.30.0 | 1,121 | 10/25/2023 |
8.28.0 | 1,270 | 9/21/2023 |
8.27.2 | 644 | 9/18/2023 |
8.27.1 | 583 | 9/18/2023 |
8.27.0 | 484 | 9/14/2023 |
8.26.0 | 711 | 9/1/2023 |
8.25.0 | 793 | 8/28/2023 |
8.24.0 | 2,019 | 7/17/2023 |
8.23.0 | 3,787 | 5/15/2023 |
8.22.0 | 4,016 | 4/3/2023 |
8.21.0 | 3,613 | 1/22/2023 |
8.20.0 | 1,190 | 1/12/2023 |
8.19.0 | 2,911 | 12/12/2022 |
8.18.0 | 1,140 | 12/8/2022 |
8.17.0 | 1,169 | 11/30/2022 |
8.16.5 | 1,183 | 11/26/2022 |
8.16.3 | 1,103 | 11/22/2022 |
8.16.2 | 1,120 | 11/16/2022 |
8.16.1 | 1,201 | 11/14/2022 |
8.16.0 | 1,197 | 11/11/2022 |
8.15.0 | 2,665 | 9/20/2022 |
8.14.0 | 1,815 | 8/24/2022 |
8.13.0 | 6,335 | 8/16/2022 |
8.12.1-patch1 | 413 | 12/28/2023 |
8.12.0 | 4,371 | 6/6/2022 |
8.9.1 | 4,361 | 4/27/2022 |
8.9.0 | 1,331 | 4/27/2022 |
8.8.0 | 2,154 | 4/17/2022 |
8.7.0 | 2,461 | 4/6/2022 |
8.6.0 | 2,588 | 3/23/2022 |
8.5.1 | 1,882 | 2/23/2022 |
8.5.0 | 1,396 | 2/18/2022 |
8.4.0 | 1,439 | 2/8/2022 |
8.3.0 | 1,442 | 1/21/2022 |
8.2.0 | 1,630 | 1/6/2022 |
8.1.0 | 1,124 | 12/28/2021 |
8.0.0 | 2,980 | 12/22/2021 |
8.0.0-beta4 | 744 | 12/21/2021 |
8.0.0-beta3 | 818 | 12/8/2021 |
8.0.0-beta2 | 210 | 12/7/2021 |
8.0.0-beta | 221 | 12/7/2021 |
8.0.0-alpha | 220 | 12/6/2021 |
7.17.0 | 3,164 | 11/30/2021 |
7.16.0 | 2,252 | 11/26/2021 |
7.15.0 | 2,924 | 11/9/2021 |
7.14.0 | 1,207 | 11/9/2021 |
7.13.0 | 1,860 | 10/19/2021 |
7.12.0 | 1,274 | 10/13/2021 |
7.10.0 | 3,512 | 6/29/2021 |
7.9.9 | 2,861 | 5/10/2021 |
7.9.6 | 1,375 | 4/30/2021 |
7.9.4 | 1,305 | 4/27/2021 |
7.9.3 | 1,345 | 4/18/2021 |
7.9.0 | 24,341 | 4/5/2021 |
7.8.1 | 2,077 | 3/21/2021 |
7.8.0 | 1,222 | 3/19/2021 |
7.7.0 | 519 | 3/15/2021 |
7.5.5 | 2,060 | 1/25/2021 |
7.5.2 | 1,913 | 1/13/2021 |
7.4.24 | 2,996 | 11/30/2020 |
7.4.19 | 2,608 | 11/6/2020 |
7.4.13 | 5,023 | 8/25/2020 |
7.4.12 | 2,337 | 8/11/2020 |
7.4.11 | 1,402 | 8/4/2020 |
7.4.10 | 1,390 | 7/30/2020 |
7.4.7 | 3,063 | 7/22/2020 |
7.4.6 | 1,395 | 7/20/2020 |
7.4.1 | 3,700 | 6/25/2020 |
7.4.0 | 1,534 | 6/19/2020 |
7.3.3 | 3,219 | 5/12/2020 |
7.3.2 | 2,033 | 5/8/2020 |
7.3.1 | 1,408 | 5/4/2020 |
7.3.0 | 1,437 | 4/25/2020 |
7.2.0 | 2,604 | 3/31/2020 |
7.2.0-beta3 | 1,499 | 3/17/2020 |
7.2.0-beta2 | 1,056 | 3/12/2020 |
7.2.0-beta | 1,213 | 2/27/2020 |
7.1.0 | 2,632 | 2/3/2020 |
7.1.0-beta4 | 1,115 | 12/11/2019 |
7.1.0-beta3 | 1,083 | 11/11/2019 |
7.1.0-beta2 | 506 | 11/5/2019 |
7.1.0-beta | 1,124 | 10/23/2019 |
7.1.0-alpha | 423 | 10/8/2019 |
7.0.0 | 4,474 | 7/1/2019 |
6.3.0 | 2,224 | 5/31/2019 |
6.2.2 | 4,407 | 5/1/2019 |
6.2.1 | 2,217 | 4/5/2019 |
6.2.1-beta4 | 529 | 3/27/2019 |
6.2.1-beta3 | 520 | 3/18/2019 |
6.2.1-beta2 | 530 | 3/17/2019 |
6.2.1-beta1 | 517 | 3/12/2019 |
6.2.0 | 2,609 | 3/4/2019 |
6.1.1 | 1,947 | 2/15/2019 |
6.1.0 | 878 | 2/1/2019 |
6.1.0-beta4 | 605 | 1/14/2019 |
6.1.0-beta3 | 627 | 1/10/2019 |
6.1.0-beta2 | 689 | 1/8/2019 |
6.1.0-beta | 635 | 1/7/2019 |
6.0.0 | 2,729 | 11/6/2018 |
6.0.0-beta | 672 | 10/30/2018 |
5.2.3 | 4,376 | 9/20/2018 |
5.2.2 | 10,514 | 7/4/2018 |
5.2.1 | 2,518 | 5/10/2018 |
5.2.0 | 1,252 | 4/29/2018 |
5.1.0 | 1,297 | 3/20/2018 |
5.0.0 | 1,220 | 3/13/2018 |
5.0.0-alpha | 955 | 3/12/2018 |
4.2.1 | 1,930 | 3/5/2018 |
4.2.0 | 1,737 | 3/1/2018 |
4.1.0 | 2,159 | 12/5/2017 |
4.1.0-alpha | 1,057 | 10/27/2017 |
4.0.0 | 1,613 | 10/23/2017 |
3.2.0 | 1,873 | 10/14/2017 |
3.1.2 | 1,865 | 9/16/2017 |
3.1.0 | 2,485 | 12/15/2016 |
3.0.0 | 1,936 | 12/6/2016 |
3.0.0-beta | 1,213 | 11/29/2016 |
3.0.0-alpha | 1,273 | 11/23/2016 |
2.3.3 | 1,787 | 11/10/2016 |
2.3.1 | 1,772 | 10/29/2016 |
2.3.0 | 1,391 | 10/28/2016 |
2.2.0 | 2,050 | 2/1/2016 |
2.1.0 | 1,250 | 1/16/2016 |
2.0.0 | 1,629 | 1/15/2016 |
2.0.0-alpha | 1,225 | 5/16/2015 |
1.0.1.20018 | 2,136 | 6/1/2014 |
1.0.0.33376 | 2,167 | 4/26/2014 |
0.5.3 | 1,716 | 2/3/2014 |
0.5.2 | 1,306 | 1/26/2014 |
0.5.0.1 | 2,524 | 1/12/2014 |
0.4.2-alpha | 1,243 | 6/16/2013 |
0.4.1-alpha | 1,172 | 6/15/2013 |
0.4.0-alpha | 1,205 | 6/14/2013 |
Version 11.2.0
- Version bump to accomodate SoundFingerprinting.Emy update to 11.2.0
Version 11.1.0
- Adjusting `IRealtimeResultEntryFilter` implementation classes, making sure we adhere to the same principles across both configuration options `ResultEntryFilter` and `OngoingResultEntryFilter`.
- Adding `ChainedRealtimeEntryFilter` which replaces `OngoingRealtimeResultEntryFilter`.
- `TrackMatchLengthEntryFilter` can be used as `TrackCoverageLengthEntryFilter(waitTillCompletion: false)`
- `OngoingRealtimeResultEntryFilter(x, y)` can be chained as new ChainedRealtimeEntryFilter([new TrackRelativeCoverageEntryFilter(x, waitTillCompletion: false), new TrackCoverageLengthEntryFilter(y, waitTillCompletion: false)`])
- `TrackRelativeCoverageLengthEntryFilter` can be used as `TrackRelativeCoverageEntryFilter(waitTillCompletion: true)`.
Version 11.0.0
- Cleanup of the codebase, removing obsolete methods and classes.
- Removed IAdvancedModelService.
- Removed obsolete Query methods from IQueryService, leaving only QueryEfficient method.
- Removed MediaType from QueryConfiguration, as it was not used anymore.
Version 10.4.0
- Added new property MetaFields to AVQueryMatch, to be able to store additional metadata about the match.
Version 10.3.0
- Improved the ability to reconstruct coverage from tone signal matches (silence can be treated as a tone signal).
- Added a fingerprinting flag that allows including silence fingerprints in the generated result set.
Version 10
- Accomodating SoundFingerprinting.Emy upgrade to FFmpeg 6.x
Version 9.5.0
- Dependency upgrade to .NET 8
Version 9.4.2
- Contains an important improvement to QueryCommand, allowing a much faster lookup for the use-cases when the track and the query are very long and almost identical.
- The improvement is rooted in the idea of returning Candidates from the IModelService instead of list of SubFingerprints. This provided knowledge on which hashed fingerprint matched with the query.
- To further improve the API design, methods related to the correct functioning of the QueryCommand were extracted into IQueryService interface (from which IModelService derives).