How to insert tracks into Emy storage.
When inserting fingerprints you need to create a TrackInfo
which allows you to specify a set of properties: ID, Title, Artist and MetaFields.
var pathToAudioFile = "adelle.mp3";
// use FFmpegAudioService
var audioService = new FFmpegAudioService();
// connect to Emy on port 3399
var emyModelService = EmyModelService.NewInstance("localhost", 3399);
// define track info
var track = new TrackInfo("GBBKS1200164", "Skyfall", "Adele", new Dictionary<string, string> {{ "Market", "US" }});
// 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);
Please assign a unique identifier for the 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 that matched.
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.