'How to Detect a specific sound in android app? [closed]

I am beginner in Android Programmming. Developing a sound detection app in Android studio. Can somebody help me to detect a specific sound ?



Solution 1:[1]

Try using musicg

musicg is a lightweight audio analysis library, written in Java, with the purpose of extracting both high level and low level audio features. This API allows developers to extract audio features and operate audio data like reading, cutting and trimming easily from an inputstream. It also provides tools for digital signal processing, renders the wavform or spectrogram for research and development purpose.

Add musicg library to your project and try this code :-

Wave w1= new Wave("first_wav"); // Base Audio file
Wave w2= new Wave("second_wav"); // Audio file to compare
// Finding Audio Fingerprint Similarity
FingerprintSimilarity fps = w1.getFingerprintSimilarity(w2);
float score = fps.getScore();
float sim = fps.getSimilarity();

sim contains the similarity between to audio files (value rages from 0 to 1.0). value greater that 0.3 can be considered as similar sound.musicg uses 16 bit PCM audio files.

but getFingerprintSimilarity() accept only wave format files.

This app uses musicg for sound detection.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 NeroVero