This project demonstrates the Google speech-API. It records speech in Max, process it using the Google API, and displays the result in a Max [message] object.
Note: The sequence of events with shell calls is handled by arbitrary delay objects. This could be cleaned up by looking for some kind of termination code to indicate the shell command has completed.
abstractions and other files
- JSON-google-speech.js (parses JSON response from Google API)
external Max objects
- [aka.shell] from http://www.iamas.ac.jp/~aka/max/ – download this external and add the folder to Options | File Preferences, in Max
sox: sox audio conversion program must be in the computer’s executable file path, ie., /usr/bin – or you can rewrite the [sprintf] input to [aka.shell] with the actual path
get sox from: http://sox.sourceforge.net
note: this conversion may not be necessary with recent updates to Max and the Google speech API
- none required – so far
- Open Max patch: speech-to-google-text-api5
- Turn on audio
- Click on the toggle (next to the level meters), say something, then un-click the toggle. The translation will begin automatically
Note: Instructions for auto-record feature are in progress, but simply use + and – keys to activate/deactivate auto record.
Note: If you have a slow internet connection you may need to increase the number in the [delay 4000] object – in “call google-speech” sub patch.
send Tweets using speech
Max [send] and [receive] objects pass data from this project to other projects that send Tweets from Max. Just run the patches at the same time.
Also, check out how this project is integrated into the Pandorabots chatbot API project
Or anything else. The Google translation is amazingly accurate.
- 4/24/2016: need to have explicit path to sox, in the call-google-speech subpatch. In my Macports version the path is /usr/local/opt/bin/sox.
- 5/11/2014: The newest version requires Max 6.1.7 (for JSON parsing). Also have updated to Google Speech API v2.
- update 3/26/2014 to use auto-record features developed for chatbot conversations