AudioProvider

class AudioProvider

Audio provider interface to supply audio to the engine.

The engine needs audio data in a specific format in order to extract the fingerprints. During indexing an audio provider must be plugged in from which the indexer can retrieve the required audio data. Any class that will handle the supply of audio must implement this interface.

Public Functions

virtual int OnAudioData(uint32_t FID, float *buffer, size_t nsamples) = 0

Called by the Indexer whenever audio data for fingerprinting is needed.

Return

The number of samples actually read or a negative value on error. When all the audio for a recording is consumed the audio provider must signal this to the engine by returing 0.

Parameters
  • [in] FID: The unique identifier of the recording being indexed.

  • [out] buffer: Pointer to the buffer that will receive the audio data. The audio must be 16 bit, mono, 11025Hz normalized in [-1,1].

  • [in] nsamples: The number of requested samples.