Soundfingerprinting is a C# framework designed for developers and researchers in the fields of audio processing, data mining, digital signal processing. It implements an efficient algorithm of signal processing which will allow one to have a competent system of audio fingerprinting and signal recognition.
See the Wiki page with the operational details and information
Following is a code sample that shows how you would generate from an audio file sound sub-fingerprints, that can be stored and used later for recognition purposes. It expects on input path to audio file (that will be fingerprinted) and track id (by which you can later identify this specific audio file).
public List<SubFingerprint> CreateSubFingerprintSignaturesFromFile(string pathToAudioFile, int trackId)
{
FingerprintUnitBuilder fingerprintUnitBuilder = new FingerprintUnitBuilder();
return fingerprintUnitBuilder.BuildAudioFingerprintingUnit()
.From(pathToAudioFile)
.WithDefaultAlgorithmConfiguration()
.FingerprintIt()
.HashIt()
.ForTrack(trackId)
.Result;
}
After generating the sub-fingerprint signatures you might want to store them for later retrieval. Below is shown a code snippet for saving them to the default underlying storage, using ModelService
class. Default storage is an MSSQL database those initialization script can be find here.
public void StoreSubFingeprintSignatures(List<SubFingerprint> subFingerprintSignatures)
{
ModelService modelService = new ModelService();
modelService.InsertSubFingerprint(fingerprintsToStore);
}
Once you've inserted the fingerprints into the database, 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 Track GetBestMatchForSong(String queryAudioFile)
{
FingerprintQueryBuilder fingerprintQueryBuilder = new FingerprintQueryBuilder();
return fingerprintQueryBuilder.BuildQuery()
.From(queryAudioFile)
.WithDefaultConfigurations()
.Query()
.Result
.BestMatch;
}
The code is still in pre-release phase, thus the signatures of the above used classes might change.
git clone git@github.com:AddictedCS/soundfingerprinting.git
In order to build latest version of the SoundFingerprinting
assembly run the following command from repository root
.\build.cmd
Install-Package SoundFingerprinting -Pre
My description of the algorithm alogside with the demo project can be found on CodeProject 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.
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.
The framework is provided under GPLv3 licence agreement.
The framework implements the algorithm from Content Fingerprinting Using Wavelets paper.
© Soundfingerprinting, 2010-2013, ciumac.sergiu@gmail.com