A noise classifier on Android smartphones.
This project is a simple Android application that classifies the incoming audio signals into five classes, namely:
- Car Horn
- Crowd
- Dog Bark
- Siren
- Vehicles
The classification process runs by utilizing the TensorFlow Lite model where it gets the input feature vector from the Extractor.java
class by utilizing the TarsosDSP library.
The details on how to get the TensorFlow Lite model is available on https://github.com/WinRoedily/NoiseClassifier_TF1
This application gets the audio signals from either the phone's default microphone or a .wav file. It extracts the MFCCs from the
sampled audio waves and pass the result either to TensorFlow Lite Interpreter
for classification or saveToCSV
to save it to .csv file.
For the classification of the audio coming from microphone, the program calls the classify
method every second, while the classification
of a .wav file runs as the extraction process finished. I use six .wav files with six seconds in duration for each file as samples where each of the five files
represents a class according to the labels I provide, and the sixth file is a mix of those five classes.
- The app requires input from the user to choose the audio source:
- From File
- horn.wav
- crowd.wav
- dog.wav
- siren_wav
- traffic.wav
- mix.wav
- From Microphone
- If you select the From File radio button, it shows the list of available audio files in the application. Select one of those and click on select file
- If you select the From Microphone radio button, you need to press on the Start button to start recording and classifying sequentially
Start | From File | From Mic |
---|---|---|
I hope this simple code can be useful, and may God bless you. 👼