Fun speech-based app to get TJBot playing (and dancing to) song snippets using Watson Apis and the Spotify apis
- Listen for voice commands containing song name e.g play {cry me a river}
- Recognize the word play and then trigger a spotify search for the song name
- Download the song preview (mp3)
- Convert to wav format (for decoding and sampling)
- Play song and dance to it.
##Dependencies
This app requires mpg321 to play an mp3 file.
sudo apt-get update
sudo apt-get install mpg321
Following this, you will need to install node Dependencies npm install
##Running
Start the application. (Note: you need sudo access)
sudo node tjdj.js
Then you should be able to speak to the microphone and ask your TJBot to play
play smooth criminal by michael jackson
play stranger in moscow
Dependencies List
- Watson Developer Cloud : Watson Speech to Text, Watson Conversation, and Watson Text to Speech.
- mic npm package : for reading audio input
- pigio npm package : Fast (software) GPIO, PWM, servo control, state change notification, and interrupt handling on the Raspberry Pi.
- web-audio-api : implementation (partial) of the HTML5 web audio api, used to decode sound files.
- underscorejs : functional programming helper library for data manipulation.
- node-aplay : Simple nodejs wrapper for aplay.
- [rpi-ws281x-native] (https://www.npmjs.com/package/rpi-ws281x-native): basic set of functions to write data to a strip of ws2811/ws2812 LEDs.