I'm trying to do what seems like a very basic task but can't find any utilities that allow for this, including sox.

I somewhat frequently clip audio fragments out of large audio files, which are typically 30 to 60 minutes long. There are hundreds, probably thousands, of these audio files. Usually, it's all good, but sometimes I want to go back and re-listen to some of the context behind what I excerpted. Sometimes, I can go back onto the site and try to remember which files I downloaded, but more often than not it doesn't work out.

Lately I've been including file names in the excerpts for reference, but I'm wondering if there's any way to search audio files. Literally, not the "speech recognition search" that most results on this topic come up with. I have the actual, exact raw audio, and it would be awesome if I could just have a script scan all the audio files in a folder and see if the clipped audio file appears in any of those files. Preferably, a utility that works with FLAC and/or uLaw audio formats, so I don't need to convert anything.

Does such a thing exist? Since this is simpler than speech recognition, I would think it would be trivial, but I can't find anything. Windows or Linux support works.

  • Have you considered adding notes to the metadata for the file? That aspect of a file is searchable.
    – fred_dot_u
    Commented Dec 14, 2020 at 22:31
  • Fascinating question! I don't personally know of such a tool, but I was thinking that if the clip is encoded the same way as the source recording, then possibly all that would be needed is to discard the clip's header info and search for the context itself in a bitwise manner. I'm not sure this would work, but it seems like a possibility for certain audio encodings. Commented Dec 15, 2020 at 0:15
  • @fred_dot_u Usually, I just add it to the file name if I do that, but I really haven't done that much. In this case, the damage is already done, though. Commented Dec 15, 2020 at 23:02
  • @RockPaperLz-MaskitorCasket That's exactly what I am thinking. I literally want to find to find an identical excerpt in another audio format. I looked into "audio fingerprinting" but it is horrendous in terms of performance and size of hashes generated. It said it would take 30% of the audio length to run, that is impractical as it would take hours and hours to search through even a small subset of interest. I think your idea sounds promising. Any ideas on how to implement it? Commented Dec 15, 2020 at 23:04

1 Answer 1


This is a case of "query by example", which for sound is usually called Audio Identification or Audio Matching. The details how it can be implemented in Python can be found in the chapters Audio Identification and Audio Matching in the book Fundamentals of Music Processing Using Python and Jupyter Notebooks (FMP) by Meinard Müller.

There is also one ready-to-use, open-source, software that I am aware of: Dejavu. Using Dejavu one can index audio clips into a database, and then make queries against this database. It uses Audio Fingerprinting to perform the Audio Identification. It is implemented in Python and can be ran as a service inside Docker.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.