{"id":13577899,"url":"https://github.com/AddictedCS/soundfingerprinting","last_synced_at":"2025-04-05T15:31:51.527Z","repository":{"id":1871241,"uuid":"2796453","full_name":"AddictedCS/soundfingerprinting","owner":"AddictedCS","description":"Open source audio fingerprinting in .NET. An efficient algorithm for acoustic fingerprinting written purely in C#.  ","archived":false,"fork":false,"pushed_at":"2025-03-10T14:30:46.000Z","size":63448,"stargazers_count":974,"open_issues_count":8,"forks_count":193,"subscribers_count":71,"default_branch":"develop","last_synced_at":"2025-03-30T07:00:41.332Z","etag":null,"topics":["acoustic-fingerprints","algorithm","audio","audio-processing","c-sharp","fingerprints","locality-sensitive-hashing","nearest-neighbor-search","recognition","shazam"],"latest_commit_sha":null,"homepage":"https://emysound.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"pinterest/PINCache","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AddictedCS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-11-17T15:36:24.000Z","updated_at":"2025-03-25T12:49:40.000Z","dependencies_parsed_at":"2023-02-12T17:30:47.755Z","dependency_job_id":"e5ba507b-fe0b-4c89-8efd-14607e48071e","html_url":"https://github.com/AddictedCS/soundfingerprinting","commit_stats":{"total_commits":1832,"total_committers":11,"mean_commits":"166.54545454545453","dds":"0.43231441048034935","last_synced_commit":"4f5f78b2ad161ecf585c61a59a03ce6612e5ad57"},"previous_names":[],"tags_count":113,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AddictedCS%2Fsoundfingerprinting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AddictedCS%2Fsoundfingerprinting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AddictedCS%2Fsoundfingerprinting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AddictedCS%2Fsoundfingerprinting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AddictedCS","download_url":"https://codeload.github.com/AddictedCS/soundfingerprinting/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247358886,"owners_count":20926310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acoustic-fingerprints","algorithm","audio","audio-processing","c-sharp","fingerprints","locality-sensitive-hashing","nearest-neighbor-search","recognition","shazam"],"created_at":"2024-08-01T15:01:25.284Z","updated_at":"2025-04-05T15:31:46.517Z","avatar_url":"https://github.com/AddictedCS.png","language":"C#","readme":"## Audio/Video fingerprinting and recognition in .NET\n\n[![Join the chat at https://gitter.im/soundfingerprinting/Lobby](https://badges.gitter.im/soundfingerprinting/Lobby.svg)](https://gitter.im/soundfingerprinting/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n![.NET Core](https://github.com/AddictedCS/soundfingerprinting/workflows/.NET%20Core/badge.svg)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](license.txt)\n[![NuGet](https://img.shields.io/nuget/dt/SoundFingerprinting.svg)](https://www.nuget.org/packages/SoundFingerprinting)\n\n_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.\n\n## Documentation\n\nFull documentation is available on the [Wiki][wiki-page] page.\n\nBelow 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.\n\n```csharp\nprivate readonly IModelService modelService = new InMemoryModelService(); // store fingerprints in RAM\nprivate readonly IAudioService audioService = new SoundFingerprintingAudioService(); // default audio library\n\npublic async Task StoreForLaterRetrieval(string file)\n{\n    var track = new TrackInfo(\"GBBKS1200164\", \"Skyfall\", \"Adele\");\n\n    // create fingerprints\n    var avHashes = await FingerprintCommandBuilder.Instance\n                                .BuildFingerprintCommand()\n                                .From(file)\n                                .UsingServices(audioService)\n                                .Hash();\n\t\t\t\t\t\t\t\t\n    // store hashes in the database for later retrieval\n    modelService.Insert(track, avHashes);\n}\n```\n\n### Querying\nOnce 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.\n\n```csharp\n\npublic async Task\u003cTrackData\u003e GetBestMatchForSong(string file)\n{\n    int secondsToAnalyze = 10; // number of seconds to analyze from query file\n    int startAtSecond = 0; // start at the begining\n\t\n    // query the underlying database for similar audio sub-fingerprints\n    var queryResult = await QueryCommandBuilder.Instance.BuildQueryCommand()\n                                         .From(file, secondsToAnalyze, startAtSecond)\n                                         .UsingServices(modelService, audioService)\n                                         .Query();\n    \n    return queryResult.BestMatch.Track;\n}\n```\n### Fingerprints Storage\nThe default storage, which comes bundled with _soundfingerprinting_ NuGet package, is a plain in-memory storage, available via \u003ccode\u003eInMemoryModelService\u003c/code\u003e 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][emy-wiki-page].\n\n### Supported audio/video formats\nRead [Supported Media Formats][audio-services-wiki-page] page for details about processing different file formats or realtime streams.\n\n### Video fingerprinting support since version 8.0.0\nSince `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][video-fingerprinting-wiki-page].\n\n### Version Matrix\nIf you are using `FFmpegAudioService` as described in the [wiki][audio-services-wiki-page], follow the below version matrix.\n| SoundFingerprinting  | SoundFingerprinting.Emy | FFmpeg |\n| ---- | ------ |-----|\n| 8.x  | 8.x    | 4.x |\n| 9.x  | 9.x    | 5.x |\n| 10.x | 10.x   | 6.x |\n\n\n\n### FAQ\n- Can I apply this algorithm for speech recognition purposes?\n\u003e No. The granularity of one fingerprint is roughly ~1.46 seconds.\n- Can the algorithm detect exact query position in resulted track?\n\u003e Yes.\n- Can I use **SoundFingerprinting** to detect ads in radio streams?\n\u003e Yes. Actually this is the most frequent use-case where SoundFingerprinting was successfully used.\n- How many tracks can I store in `InMemoryModelService`?\n\u003e 100 hours of content with `DefaultFingerprintingConfiguration` will consume ~5GB of RAM.\n\n### Get it on NuGet\n\n    Install-Package SoundFingerprinting\n### How it works\n[Audio Fingerprinting][emysound-how-it-works].\n\n[Video Fingerprinting][emysound-video-fingerprinting].\n\n    \n### Demo\nMy description of the algorithm alogside with the demo project can be found on [CodeProject](http://www.codeproject.com/Articles/206507/Duplicates-detector-via-audio-fingerprinting). The article is from 2011, and may be outdated.\nThe demo project is a Audio File Duplicates Detector. Its latest source code can be found [here](src/SoundFingerprinting.DuplicatesDetector). Its a WPF MVVM project that uses the algorithm to detect what files are perceptually very similar.\n\n### Contribute\nIf you want to contribute you are welcome to open issues or discuss on [issues](https://github.com/AddictedCS/soundfingerprinting/issues) page. Feel free to contact me for any remarks, ideas, bug reports etc. \n\n### License\nThe framework is provided under [MIT](https://opensource.org/licenses/MIT) license agreement.\n\n\u0026copy; Soundfingerprinting, 2010-2024, sergiu@emysound.com\n\n\n[emy-nuget]: https://www.nuget.org/packages/SoundFingerprinting.Emy\n[emysound-how-it-works]: https://emysound.com/blog/open-source/2020/06/12/how-audio-fingerprinting-works.html\n[emysound-video-fingerprinting]: https://emysound.com/blog/open-source/2021/08/01/video-fingerprinting.html\n[emysound]: https://emysound.com\n[wiki-page]: https://github.com/AddictedCS/soundfingerprinting/wiki\n[emy-wiki-page]: https://github.com/AddictedCS/soundfingerprinting/wiki/Emy-Storage\n[audio-services-wiki-page]: https://github.com/AddictedCS/soundfingerprinting/wiki/Audio-Services\n[video-fingerprinting-wiki-page]: https://github.com/AddictedCS/soundfingerprinting/wiki/Video-Fingerprints\n","funding_links":[],"categories":["C# #","C#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAddictedCS%2Fsoundfingerprinting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAddictedCS%2Fsoundfingerprinting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAddictedCS%2Fsoundfingerprinting/lists"}