Skip to content

dorucioclea/soundfingerprinting.sql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sound Fingerprinting MSSQL

soundfingerprinting.sql persistent storage implementation which allows storing soundfingerprinting algorithm's data objects in MSSQL database.

Usage

The MSSQL database initialization script can be find here. Do not forget to add connection string FingerprintConnectionString in your app.config filex

<connectionStrings>
    <add name="FingerprintConnectionString" connectionString="Data Source=(local);Initial Catalog=FingerprintsDb;Integrated Security=True; Connection Timeout=15;" providerName="System.Data.SqlClient"/>
</connectionStrings>

Use SqlModelService class when fingerprinting and querying

private readonly IModelService modelService = new SqlModelService(); // SQL back end
private readonly IAudioService audioService = new NAudioService(); // use NAudio audio processing library
private readonly IFingerprintCommandBuilder fingerprintCommandBuilder = new FingerprintCommandBuilder();

public void StoreAudioFileFingerprintsInStorageForLaterRetrieval(string pathToAudioFile)
{
    TrackData track = new TrackData("GBBKS1200164", "Adele", "Skyfall", "Skyfall", 2012, 290);
	
    // store track metadata in the database
    var trackReference = modelService.InsertTrack(track);

    // create sub-fingerprints and its hash representation
    var hashedFingerprints = fingerprintCommandBuilder
                                .BuildFingerprintCommand()
                                .From(pathToAudioFile)
                                .UsingServices(audioService)
                                .Hash()
                                .Result;
								
    // store sub-fingerprints and its hash representation in the database 
    modelService.InsertHashedFingerprintsForTrack(hashedFingerprints, trackReference); // insert in SQL backend
}

Binaries

git clone git@github.com:AddictedCS/soundfingerprinting.sql.git

In order to build latest version of the SoundFingerprinting.SQL assembly run the following command from repository root .\build.cmd

Get it on NuGet

Install-Package SoundFingerprinting.SQL

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.

Licence

The framework is provided under MIT licence agreement.

About

MSSQL data access layer for Sound Fingerprinting algorithm

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 98.7%
  • Other 1.3%