This folder contains the SoundWatch application on the Android phone.
- Record audio in the background and continuously recognizing sounds based on different architectures
- Display sound notification with vibration
servicefolder containsForegroundServiceto continuously record audio data and stream data to the ML model or to phone/server andSnoozeSoundServiceto listen for snooze events from the Android phone app to stop listen to particular sounds.DataLayerListenerServiceis the main service to receive messages from watch, including the predicted sound label from the phone as well as snooze events.pythonfolder contains necessary Python utility functions to convert raw audio to MFCC features fromvggish_input.pythrough functionaudio_samplesinmain.py
Description: Convert raw audio sound of 16000 float elements (in 1 second) to corresponding label by using tflite model
Parameters:
soundBuffer:List<Short>recordTime:long
Pseudocode:
- Check if decibel threshold is large enough (to ensure the sound is sufficiently large)
- Compute MFCC features from raw audio by utilizing Chaquopy to run
pythonfunction. - If the accuracy is larger than the minimum threshold, the sound label is sent to
MainActivityto display watch notification by sending aBroadCastIntent
Description: Display audio notification to watch with vibration which shows sound label and accuracy percentage
Parameters:
audioLabel:AudioLabel
Pseudocode:
- Take in an
AudioLabelobject that has all information about the sound (label, accuracy) to display. Use Android Notification feature of Android to display the notification
If use WATCH_ONLY_ARCHITECTURE, please copy the tflite model into assets folder in Wearable src folder, and specify the filename inside MODEL_FILENAME in SoundRecorder but the watch can be heated up fast so be careful!