Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 2.15 KB

File metadata and controls

38 lines (24 loc) · 2.15 KB

Interpreter

Video Introduction

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

Link to Flow JSON

interpreter flow

Flow description

  • microphone clicking the button toggles recording, the node sends a buffer of the recorded audio as the msg.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 the msg.payloadobject as required by the subsequent nodes.
  • language translation translates the string into a different language using the Language 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 the msg.payloadobject as required by the subsequent node.
  • play audio plays the translated audio buffer from the device's speakers

Gotchas

  • The microphone node requires an HTTPS connection