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
microphone
clicking the button toggles recording, the node sends a buffer of the recorded audio as themsg.payload
object.speech to text
converts the buffer into text using the Watson Speech-to-Text services.set msg.payload
moves the string output of speech to text to themsg.payload
object as required by the subsequent nodes.language translation
translates the string into a different language using theLanguage Translation
service.text to speech
converts the string into spoken word using the Watson Text-to-Speech services.set msg.payload
moves the audio output of the previous node to themsg.payload
object as required by the subsequent node.play audio
plays the translated audio buffer from the device's speakers
- The microphone node requires an
HTTPS
connection