How to use Watson text-to-speech api in node.js?
<p>Im a beginner at using express and node.js. I am confused on how to use Watson api and I can barely understand the documentations/apis. I just want to be able to try using the watson api to my application. So I will just enumerate what I did and where I got stuck.</p>

<p>So first I executed this at the command line, to get the framework.</p>

<pre><code>express test
</code></pre>

<p>Then I did installed the dependencies using this command.</p>

<pre><code>cd test &amp;&amp; npm install
</code></pre>

<p>Then I installed watson via the command</p>

<pre><code>npm install watson-developer-cloud
</code></pre>

<p>Then I placed this code at my app.js file.</p>

<pre><code>var TextToSpeechV1 = require('watson-developer-cloud/text-to-speech/v1');
var fs = require('fs');

var text_to_speech = new TextToSpeechV1({
    username: 'INSERT YOUR USERNAME FOR THE SERVICE HERE', (placed my username and password)
    password: 'INSERT YOUR PASSWORD FOR THE SERVICE HERE'
});

var params = {
    text: 'Hello from IBM Watson',
    voice: 'en-US_AllisonVoice', // Optional voice
    accept: 'audio/wav'
};

// Pipe the synthesized text to a file
text_to_speech.synthesize(params).pipe(fs.createWriteStream('output.wav'));
</code></pre>

<p>So I know that means I am creating a Watson object. But I do not know where to go from here. I just want to be able to create a simple text to speech, wherein there is a textbox and a speak button.</p>