public ResultEntry GetBestMatchForAudioClip(AudioClip clip)
    {
        var audioSamples = AudioClipBridge.AudioClipToAudioSamples(clip);

        // query the underlying database for similar audio sub-fingerprints
        var queryResult = QueryCommandBuilder.Instance.BuildQueryCommand()
                          .From(audioSamples)
                          .UsingServices(modelService, audioService)
                          .Query()
                          .Result;

        return(queryResult.BestMatch);        // successful match has been found
    }
    public void StoreAudioClipFingerprintsInStorageForLaterRetrieval(AudioClip clip)
    {
        var track        = new TrackData("unknown", "ARTIST", "TRACK", "ALBUM", 1988, 290);
        var audioSamples = AudioClipBridge.AudioClipToAudioSamples(clip);

//Debug.Log("Storing reference file (samples: " + audioSamples.Samples.Length);
        // store track metadata in the datasource
        var trackReference = modelService.InsertTrack(track);

        // create hashed fingerprints
        var hashedFingerprints = FingerprintCommandBuilder.Instance
                                 .BuildFingerprintCommand()
                                 .From(audioSamples)
                                 .UsingServices(audioService)
                                 .Hash()
                                 .Result;

        // store hashes in the database for later retrieval
        modelService.InsertHashDataForTrack(hashedFingerprints, trackReference);
    }