1

I am new to node js and am working with IBM's speech to text sample application (https://github.com/watson-developer-cloud/speech-to-text-nodejs). It uses the express framework and prints transcribed audio from the microphone to a text box on the webpage as well as the browser console. Other examples I have seen using express have outputed to the command line console. Can anyone explain to me why console.log is outputing to the browser console instead of the command line?

Thanks so much

1 Answer 1

3

console.log outputs into browser console because it runs on client-side. In few sentences: When you type 'http://localhost:3000' in your browser, your browser makes GET request to '/' of your nodejs app. As you can see, this request is processed at 47 line of app.js. Your application renders ./views/index.ejs file into html page and sends it to the client. So, all logic runs on client-side. Your nodejs application just providing html page to the user. If you want to run speech recognition on server-side you can do one of next: 1. stream audio data from micro to server, and then recognize it on server. 2. save audio data on client-side until recording ends, and then send saved data to server, server will recognize it. (like audio file to text recognition) 3. google about watson server-server speech recognition.

Sign up to request clarification or add additional context in comments.

2 Comments

I believe 1) sounds like what I want. If I understand what you are saying, I should get the audio input directly from my microphone and stream it to the server? Instead of using the browsers microphone recognition? Could something like this be used: npmjs.com/package/microphone ?
amartin7211 if you want to use nodejs app as console application for speech recognition and you don't need to recognize microphone from client side at all - you can use that microphone npm package on server-side. But use nodejs as console application is dark side way IMHO. If you want that users can recognize speech through your server instead of direct recognition from IBM, you should stream data from microphone to server and then recognize it on server. You also can recognize all on client, and send results of recognition to server. And print results on server, for example. It is simpler.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.