Skip to content

Commit

Permalink
add list of supported language models
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor committed Dec 12, 2016
1 parent a0ac615 commit 1a00615
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
26 changes: 23 additions & 3 deletions recipes/conversation/conversation.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,35 @@ var textStream ;
************************************************************************
In this step, the audio sample is sent (piped) to "Watson Speech to Text" to transcribe.
The service converts the audio to text and saves the returned text in "textStream"
You can also set the language model for your speech input.
The following language models are available
ar-AR_BroadbandModel
en-UK_BroadbandModel
en-UK_NarrowbandModel
en-US_BroadbandModel (the default)
en-US_NarrowbandModel
es-ES_BroadbandModel
es-ES_NarrowbandModel
fr-FR_BroadbandModel
ja-JP_BroadbandModel
ja-JP_NarrowbandModel
pt-BR_BroadbandModel
pt-BR_NarrowbandModel
zh-CN_BroadbandModel
zh-CN_NarrowbandModel
*/

textStream = micInputStream.pipe(speech_to_text.createRecognizeStream({
var recognizeparams = {
content_type: 'audio/l16; rate=44100; channels=2',
interim_results: true,
keywords: [attentionWord],
smart_formatting: true,
keywords_threshold: 0.5
}));
keywords_threshold: 0.5,
model: 'en-US_BroadbandModel' // Specify your language model here
};


textStream = micInputStream.pipe(speech_to_text.createRecognizeStream(recognizeparams));

textStream.setEncoding('utf8');

Expand Down
5 changes: 2 additions & 3 deletions recipes/speech_to_text/stt.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ console.log("TJBot is listening, you may speak now.");
In this step, the audio sample is sent (piped) to "Watson Speech to Text" to transcribe.
The service converts the audio to text and saves the returned text in "textStream".
You can also set the language model for your speech input.
The following language models are available
The following language models are available
ar-AR_BroadbandModel
en-UK_BroadbandModel
en-UK_NarrowbandModel
Expand All @@ -84,7 +83,7 @@ The following language models are available
var recognizeparams = {
content_type: 'audio/l16; rate=44100; channels=2',
model: 'en-US_BroadbandModel' // Specify your language model here
}
};
var textStream = micInputStream.pipe(
speech_to_text.createRecognizeStream(recognizeparams)
);
Expand Down

0 comments on commit 1a00615

Please sign in to comment.