Reputation: 1
What I wanna do is just like 'Shazam' or 'SoundHound' with Python, only sound version, not music.
For example, when I make sound(e.g door slam), find the most similar sound data in the sound list.
I don't know you can understand that because my English is bad, but just imagine the sound version of 'Shazam'.
I know that 'Shazam' doesn't have open API. Is there any api like 'Shazam'? Or, How can I implement it?
Upvotes: 0
Views: 3255
Reputation: 11
The problem here is that music has structure, while the sounds you want to find may have different signatures. Using the door as an example, the weight, size and material of the door alone will influence the types of acoustic signatures it will produce. If you want to search by similarity, a bag-of-features approach may be the easy(ish) way to go. However, there are different approaches, such as taking samples by a sliding window along the spectrogram of a sound, and trying to match (by similarity) with a previous sound you recorded, decomposition of the sound, etc...
Upvotes: 0
Reputation: 4009
There are several libraries you can use, but none of them will classify a sample as a 'door shut' for example. BUT you can use those libraries for feature extraction and build/get a data set of sound, build a classifier, train it and use it for sound classification.
The libraries:
Friture - Friture is a graphical program designed to do time-frequency analysis on audio input in real-time. It provides a set of visualization widgets to display audio data, such as a scope, a spectrum analyser, a rolling 2D spectrogram.
LibXtract - LibXtract is a simple, portable, lightweight library of audio feature extraction functions. The purpose of the library is to provide a relatively exhaustive set of feature extraction primatives that are designed to be 'cascaded' to create a extraction hierarchies.
Yaafe - Yet Another Audio Feature Extractor is a toolbox for audio analysis. Easy to use and efficient at extracting a large number of audio features simultaneously. WAV and MP3 files supported, or embedding in C++, Python or Matlab applications.
Aubio - Aubio is a tool designed for the extraction of annotations from audio signals. Its features include segmenting a sound file before each of its attacks, performing pitch detection, tapping the beat and producing midi streams from live audio.
LibROSA - A python module for audio and music analysis. It is easy to use, and implements many commonly used features for music analysis.
If you do choose to use my advise as I mention above, I recommend on scikit-learn as Machine Learning libraries. It contains a lot of classifiers you may want to use.
Upvotes: 2