Skip to content

Commit 45027ca

Browse files
committed
docs: note in the examples that access_token should be used if using RC
1 parent 892304c commit 45027ca

20 files changed

+51
-48
lines changed

examples/server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ var sttAuthService = new AuthorizationV1(
8888
Object.assign(
8989
{
9090
username: process.env.SPEECH_TO_TEXT_USERNAME, // or hard-code credentials here
91-
password: process.env.SPEECH_TO_TEXT_PASSWORD
91+
password: process.env.SPEECH_TO_TEXT_PASSWORD,
92+
iam_apikey: process.env.SPEECH_TO_TEXT_IAM_APIKEY // if using an RC service
9293
},
9394
vcapServices.getCredentials('speech_to_text') // pulls credentials from environment in bluemix, otherwise returns {}
9495
)
@@ -114,7 +115,8 @@ var ttsAuthService = new AuthorizationV1(
114115
Object.assign(
115116
{
116117
username: process.env.TEXT_TO_SPEECH_USERNAME, // or hard-code credentials here
117-
password: process.env.TEXT_TO_SPEECH_PASSWORD
118+
password: process.env.TEXT_TO_SPEECH_PASSWORD,
119+
iam_apikey: process.env.TEXT_TO_SPEECH_IAM_APIKEY // if using an RC service
118120
},
119121
vcapServices.getCredentials('text_to_speech') // pulls credentials from environment in bluemix, otherwise returns {}
120122
)

examples/static/file-ajax.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h2>Code for this demo:</h2>
4040
var file = values[1];
4141

4242
return WatsonSpeech.SpeechToText.recognizeFile({
43-
token: token,
43+
token: token, // use `access_token` as the parameter name if using an RC service
4444
file: file,
4545
outputElement: '#output',
4646
play: true

examples/static/file-upload.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ <h2>Code for this demo:</h2>
3838
}).then(function (token) {
3939

4040
stream = WatsonSpeech.SpeechToText.recognizeFile({
41-
token: token,
41+
token: token, // use `access_token` as the parameter name if using an RC service
4242
file: document.querySelector('#audiofile').files[0],
4343
play: true, // play the audio out loud
4444
outputElement: '#output' // CSS selector or DOM Element (optional)

examples/static/file-url.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h2>Code for this demo:</h2>
4141

4242
button.onclick = function () {
4343
WatsonSpeech.SpeechToText.recognizeFile({
44-
token: token,
44+
token: token, // use `access_token` as the parameter name if using an RC service
4545
file: '/Us_English_Broadband_Sample_1.wav',
4646
outputElement: '#output',
4747
play: true

examples/static/microphone-alternatives.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ <h2>Code for this demo:</h2>
3737
}).then(function (token) {
3838

3939
var stream = WatsonSpeech.SpeechToText.recognizeMicrophone({
40-
token: token,
40+
token: token, // use `access_token` as the parameter name if using an RC service
4141
objectMode: true,
4242
max_alternatives: 4
4343
});

examples/static/microphone-streaming-auto-stop.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2>Code for this demo:</h2>
3333
}).then(function (token) {
3434

3535
var stream = WatsonSpeech.SpeechToText.recognizeMicrophone({
36-
token: token,
36+
token: token, // use `access_token` as the parameter name if using an RC service
3737
outputElement: '#output' // CSS selector or DOM Element
3838
});
3939

examples/static/microphone-streaming-model.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h2>Code for this demo:</h2>
5858
getTtsToken().then(function (token) {
5959

6060
var stream = WatsonSpeech.SpeechToText.recognizeMicrophone({
61-
token: token,
61+
token: token, // use `access_token` as the parameter name if using an RC service
6262
model: document.querySelector('#model').value,
6363
outputElement: '#output' // CSS selector or DOM Element
6464
});

examples/static/microphone-streaming-object-extracted-to-console.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h2>Code for this demo:</h2>
3434
}).then(function (token) {
3535

3636
var stream = WatsonSpeech.SpeechToText.recognizeMicrophone({
37-
token: token,
37+
token: token, // use `access_token` as the parameter name if using an RC service
3838
objectMode: true, // send objects instead of text
3939
extractResults: true, // convert {results: [{alternatives:[...]}], result_index: 0} to {alternatives: [...], index: 0}
4040
format: false // optional - performs basic formatting on the results such as capitals an periods

examples/static/microphone-streaming-object-to-console.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h2>Code for this demo:</h2>
3434
}).then(function (token) {
3535

3636
var stream = WatsonSpeech.SpeechToText.recognizeMicrophone({
37-
token: token,
37+
token: token, // use `access_token` as the parameter name if using an RC service
3838
objectMode: true, // send objects instead of text
3939
format: false // optional - performs basic formatting on the results such as capitals an periods
4040

examples/static/microphone-streaming-preload-token.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h2>Code for this demo:</h2>
3939

4040
document.querySelector('#button').onclick = function () {
4141
var stream = WatsonSpeech.SpeechToText.recognizeMicrophone({
42-
token: token,
42+
token: token, // use `access_token` as the parameter name if using an RC service
4343
outputElement: '#output' // CSS selector or DOM Element
4444
});
4545

0 commit comments

Comments
 (0)