Interpreter
October 1, 2016 ยท View on GitHub
Overview
This Node-RED flow translates audio recorded by the microphone into a variety of languages directly from the flow itself.
The flow uses the Microphone and Play Audio nodes with the Watson Speech-to-Text, Language Translation and Text-to-Speech to perform the role of an interpreter.
Node-RED will:
- Record audio from the device microphone
- Convert the audio to a string using Speech-to-Text
- Translate the string into a different language using the Language Translation service
- Convert the text response back to spoken word using Text-to-Speech
- Output the resulting audio via the device speakers
Application flow

Flow description
microphoneclicking the button toggles recording, the node sends a buffer of the recorded audio as themsg.payloadobject.speech to textconverts the buffer into text using the Watson Speech-to-Text services.set msg.payloadmoves the string output of speech to text to themsg.payloadobject as required by the subsequent nodes.language translationtranslates the string into a different language using theLanguage Translationservice.text to speechconverts the string into spoken word using the Watson Text-to-Speech services.set msg.payloadmoves the audio output of the previous node to themsg.payloadobject as required by the subsequent node.play audioplays the translated audio buffer from the device's speakers
Gotchas
- The microphone node requires an
HTTPSconnection