Skip to content

Audio Services

Sergiu Ciumac edited this page Nov 30, 2023 · 20 revisions

Decoding various audio/video formats

The very first thing that SoundFingerprinting library does in the processing pipeline, it decodes audio samples (or video frames) from the underlying media file. It has to extract AudioSamples for audio fingerprints (or Frames for video fingerprints).

The decoding is done by instances of the following interfaces that you can specify in the UsingServices method overload during fingerprint creation or querying:

  • IAudioService - used for audio fingerprinting.
    • SoundFingerprintingAudioService
    • FFmpegAudioService
    • NAudioService
    • BassAudioService
  • IVideoService - used for video fingerprinting.
    • FFmpegAudioService
  • IMediaService - used for both audio and video fingerprinting.
    • FFmpegAudioService

You can implement your own class and use it in the processing pipeline if neither of these implementations meet your requirements (i.e., none of the classes can decode file format specific to your use case).

What service is suitable for you?

  1. SoundFingerprintingAudioService comes bundled with the core SoundFingerprinting library. It supports only WAV files at the input. This implementation is known to alias the audio signal during downsampling. Use this implementation only in testing environments. Supported in any OS. MIT licensed.

  2. FFmpegAudioService comes bundled with SoundFingerprinting.Emy package. FFmpegAudioService is also the only currently supported service that can be used to read video files, providing the ability to fingerprint video frames and audio samples. Best suited for the production environment due to speed and accuracy. It provides ways to read audio from any format that is supported by FFmpeg (that is almost any known format). It is also able to extract audio tracks directly from video files. To use FFmpegAudioService you need to have it installed on the machine that fingerprints the files:

    • Windows - download FFmpeg libraries for x64 platform. Place the files alongside your executable in the following folder: FFmpeg\bin\x64. The recommended version is ffmpeg-5.1.2-full_build-shared.
    • Debian 12 - apt-get install ffmpeg (only supported with SoundFingerprinting.Emy v9.x)
    • Debian 11 - apt-get install ffmpeg (only supported with SoundFingerprinting.Emy v8.x)
    • Alpine - apk add ffmpeg (verify with ffmpeg --version which version is installed). FFmpeg v5 is supported only with SoundFingerprinting.Emy v9.x.
    • MacOS - brew install ffmpeg@5
      • Make sure you install ffmpeg@5 for SoundFingerprinting.Emy v9.x
      • Make sure you install ffmpeg@4 for SoundFingerprinting.Emy v8.x

    SoundFingerprinting.Emy is free for non-commercial use. Please contact sergiu@emysound.com for details. Supported FFmpeg versions: v5.x.x with SoundFingerprinting.Emy v9.x and v4.x.x with SoundFingerprinting.Emy v8.x.

Version matrix
FFmpeg v4 v5 v6
SoundFingerprinting.Emy v8 v9 Not Supported
  1. NAudioService suitable for the Windows environment only. Available via SoundFingerprinting.Audio.NAudio NuGet package. Provides support for .mp3 audio file processing. MIT licensed.

  2. Deprecated BassAudioService available for Windows and Unix environment via SoundFingerprinting.Audio.Bass NuGet package. Supports multiple audio formats (.wav, .ogg, .mp3, .flac). Bass is free for non-comercial use. Installation details can be found here.

Clone this wiki locally