Documentation

How to insert audio files into Emy

You have a file adelle.wav which you would like to fingerprint for later retrieval. Once you have started Emy server, you can do it either via native C# library, or JSON API.

Please assign a unique key for track ID. Multiple insert calls with the same ID, will overwrite previous fingerprints. Later, during query operation, you will receive track IDs in the response, identifying the track which was recognized.

You can attach any number of meta-fields to the TrackInfo object. These fields can be used to enrich your data model specific to your application.

Insert configuration

Out of the box Emy will use default fingerprinting configuration. It will suite the majority of use cases. In case you would like to fine-tune the behavior of the algorithm, the following configuration parameters are available:

  • Stride - the gap between consecutive fingerprints. Default value 512, measured in audio samples.
  • FrequencyRange - frequency range to analyze. Default value 318-2000, measured in Hertz.

// connect to Emy on port 3399
var emyModelService = EmyModelService.NewInstance("localhost", 3399);
    
// define track info
var track = new TrackInfo("GBBKS1200164", "Skyfall", "Adele", 290d);
 
// create fingerprints
var hashedFingerprints = await FingerprintCommandBuilder.Instance
                                 .BuildFingerprintCommand()
                                 .From(pathToAudioFile)
                                 .UsingServices(audioService)
                                 .Hash();
 								
// store hashes in the database for later retrieval
emyModelService.Insert(track, hashedFingerprints);


Coming soon!

How to query Emy storage

Once you have stored audio fingerprints, you are ready to search them.

The query audio files can come from a variety of sources: microphone, stream capture, mobile device, etc. It's up to your application where from you get the query samples.

Query configuration

Out of the box Emy will use default query configuration values. In case you would like to change the defaults, below is the list of available configuration parameters:

  • Stride - the gap between consecutive query fingerprints. In contrast to insert stride, query stride is a range value, expecting a minimum and a maximum. Range is needed in order to randomize the gap, tackling the problem of unlucky time alignment between query and insert fingerprints. Default value 256-512.
  • ThresholdVotes - controls the accuracy of the search algorithm. Default value 4.
  • AllowMultipleMatchesOfTheSameTrackInQuery - sets a value indicating whether the algorithm should search for multiple matches of the same track in the query. Default value false.
  • FrequencyRange - frequency range, used to generate query fingerprints. Keep in mind that the same value as during insert has to be used. Default value 318-2000.
  • RelativeTo - sets the timestamp which is considered as a reference point of the query operation. Default value - none.

 // connect to Emy on port 3399
 var emyModelService = EmyModelService.NewInstance("localhost", 3399);
  
 // query Emy database
 var queryResult = await QueryCommandBuilder.Instance.BuildQueryCommand()
                                          .From(queryAudioFile, secondsToAnalyze, startAtSecond)
                                          .UsingServices(modelService, audioService)
                                          .Query();
 					
 // register matches such that they appear in the dashboard					
 emyModelService.RegisterMatches(queryResult.ResultEntries);


Coming soon!

For more details visit SoundFingerprinting GitHub page