Skip to content

Commit b117030

Browse files
fix(urls): update deprecated watsonplatform.net urls
fix #181
1 parent 65347d9 commit b117030

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

Diff for: docs/TEXT-TO-SPEECH.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ where the max length is around 1000 characters after the token is accounted for.
1111
Options:
1212

1313
- text - the text to speak
14-
- url - the Watson Text to Speech API URL (defaults to https://stream.watsonplatform.net/text-to-speech/api)
14+
- url - the Watson Text to Speech API URL (defaults to https://api.us-south.text-to-speech.watson.cloud.ibm.com)
1515
- voice - the desired playback voice's name - see .getVoices(). Note that the voices are language-specific.
1616
- customization_id - GUID of a custom voice model - omit to use the voice with no customization.
1717
- autoPlay - set to false to prevent the audio from automatically playing

Diff for: examples/.env.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Replace this if you are using a region specific service
2-
SPEECH_TO_TEXT_URL=https://stream.watsonplatform.net/speech-to-text/api
2+
SPEECH_TO_TEXT_URL=https://api.us-south.speech-to-text.watson.cloud.ibm.com
33
# If your using IAM API keys use this and do not input credentials:
44
SPEECH_TO_TEXT_IAM_APIKEY=<Your API key>
55

66
# Replace this if you are using a region specific service
7-
TEXT_TO_SPEECH_URL=https://stream.watsonplatform.net/text-to-speech/api
7+
TEXT_TO_SPEECH_URL=https://api.us-south.text-to-speech.watson.cloud.ibm.com
88
# If your using IAM API keys use this and do not input credentials:
99
TEXT_TO_SPEECH_IAM_APIKEY=<Your API key>

Diff for: speech-to-text/get-models.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
2525
```js
2626
[{
27-
"url": "https://stream.watsonplatform.net/speech-to-text/api/v1/models/en-UK_BroadbandModel",
27+
"url": "https://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/models/en-UK_BroadbandModel",
2828
"rate": 16000,
2929
"name": "en-UK_BroadbandModel",
3030
"language": "en-UK",
@@ -37,7 +37,7 @@
3737
3838
* @todo define format in @return statement
3939
* @param {Object} options
40-
* @param {String} options.url=https://stream.watsonplatform.net/speech-to-text/api URL for Watson Speech to Text API
40+
* @param {String} options.url=https://api.us-south.speech-to-text.watson.cloud.ibm.com URL for Watson Speech to Text API
4141
* @param {String} options.token auth token for CF services
4242
* @param {String} options.accessToken IAM access token for RC services
4343
* @return {Promise<T>}
@@ -52,7 +52,7 @@ module.exports = function getModels(options) {
5252
accept: 'application/json'
5353
}
5454
};
55-
var url = options.url || 'https://stream.watsonplatform.net/speech-to-text/api';
55+
var url = options.url || 'https://api.us-south.speech-to-text.watson.cloud.ibm.com';
5656
if (options.accessToken) {
5757
url = url + '/v1/models?access_token=' + options.accessToken;
5858
} else {

Diff for: speech-to-text/recognize-file.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var fetch = require('nodeify-fetch'); // like regular fetch, but with an extra m
3636
* (e.g. from a file <input>, a dragdrop target, or an ajax request)
3737
*
3838
* @param {Object} options - Also passed to {MediaElementAudioStream} and to {RecognizeStream}
39-
* @param {String} [options.url='wss://stream.watsonplatform.net/speech-to-text/api'] - Base URL for a service instance
39+
* @param {String} [options.url='wss://api.us-south.speech-to-text.watson.cloud.ibm.com'] - Base URL for a service instance
4040
* @param {String} options.token - Auth Token for CF services - see https://github.com/watson-developer-cloud/node-sdk#authorization
4141
* @param {String} options.accessToken - IAM Access Token for RC services - see https://github.com/watson-developer-cloud/node-sdk#authorization
4242
* @param {Blob|FileString} options.file - String url or the raw audio data as a Blob or File instance to be transcribed (and optionally played). Playback may not with with Blob or File on mobile Safari.

Diff for: speech-to-text/recognize-microphone.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var bitBucket = new Writable({
4646
* @param {Object} options - Also passed to {RecognizeStream}, and {FormatStream} when applicable
4747
* @param {String} options.token - Auth Token for CF services - see https://github.com/watson-developer-cloud/node-sdk#authorization
4848
* @param {String} options.accessToken - IAM Access Token for RC services - see https://github.com/watson-developer-cloud/node-sdk#authorization
49-
* @param {String} [options.url='wss://stream.watsonplatform.net/speech-to-text/api'] - Base URL for a service instance
49+
* @param {String} [options.url='wss://api.us-south.speech-to-text.watson.cloud.ibm.com'] - Base URL for a service instance
5050
* @param {Boolean} [options.format=true] - pipe the text through a FormatStream which performs light formatting. Also controls smart_formatting option unless explicitly set.
5151
* @param {Boolean} [options.keepMicrophone=false] - keeps an internal reference to the microphone stream to reuse in subsequent calls (prevents multiple permissions dialogs in firefox)
5252
* @param {String|DOMElement} [options.outputElement] pipe the text to a [WriteableElementStream](WritableElementStream.html) targeting the specified element. Also defaults objectMode to true to enable interim results.

Diff for: speech-to-text/recognize-stream.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var qs = require('../util/querystring.js');
3434
* Note that the WebSocket connection is not established until the first chunk of data is recieved. This allows for auto-detection of content type (for wav/flac/opus audio).
3535
*
3636
* @param {Options} options
37-
* @param {string} [options.url] - Base url for service (default='wss://stream.watsonplatform.net/speech-to-text/api')
37+
* @param {string} [options.url] - Base url for service (default='wss://api.us-south.speech-to-text.watson.cloud.ibm.com')
3838
* @param {OutgoingHttpHeaders} [options.headers] - Only works in Node.js, not in browsers. Allows for custom headers to be set, including an Authorization header (preventing the need for auth tokens)
3939
* @param {boolean} [options.readableObjectMode] - Emit `result` objects instead of string Buffers for the `data` events. Does not affect input (which must be binary)
4040
* @param {boolean} [options.objectMode] - Alias for readableObjectMode
@@ -158,7 +158,7 @@ RecognizeStream.prototype.initialize = function() {
158158
}
159159
var queryString = qs.stringify(queryParams);
160160

161-
var url = (options.url || 'wss://stream.watsonplatform.net/speech-to-text/api').replace(/^http/, 'ws') + '/v1/recognize?' + queryString;
161+
var url = (options.url || 'wss://api.us-south.speech-to-text.watson.cloud.ibm.com').replace(/^http/, 'ws') + '/v1/recognize?' + queryString;
162162

163163
// process opening payload params
164164
var openingMessageParamsAllowed = [

Diff for: text-to-speech/get-voices.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"language": "en-US",
2929
"customizable": true,
3030
"gender": "male",
31-
"url": "https://stream.watsonplatform.net/text-to-speech/api/v1/voices/en-US_MichaelVoice",
31+
"url": "https://api.us-south.text-to-speech.watson.cloud.ibm.com/v1/voices/en-US_MichaelVoice",
3232
"description": "Michael: American English male voice."
3333
},
3434
//...
@@ -38,7 +38,7 @@
3838
3939
* @todo define format in @return statement
4040
* @param {Object} options
41-
* @param {String} options.url=https://stream.watsonplatform.net/text-to-speech/api URL for Watson Text to Speech API
41+
* @param {String} options.url=https://api.us-south.text-to-speech.watson.cloud.ibm.com URL for Watson Text to Speech API
4242
* @param {String} options.token auth token for CF services
4343
* @param {String} options.accessToken IAM access token for RC services
4444
* @return {Promise.<T>}
@@ -53,7 +53,7 @@ module.exports = function getVoices(options) {
5353
accept: 'application/json'
5454
}
5555
};
56-
var url = options.url || 'https://stream.watsonplatform.net/text-to-speech/api';
56+
var url = options.url || 'https://api.us-south.text-to-speech.watson.cloud.ibm.com';
5757
if (options.accessToken) {
5858
url = url + '/v1/voices?access_token=' + options.accessToken;
5959
} else {

Diff for: text-to-speech/synthesize.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var qs = require('../util/querystring.js');
2727
* Creates and returns a HTML5 `<audio>` element
2828
*
2929
* @param {Object} options
30-
* @param {String} options.url=https://stream.watsonplatform.net/text-to-speech/api URL for Watson Text to Speech API
30+
* @param {String} options.url=https://api.us-south.text-to-speech.watson.cloud.ibm.com URL for Watson Text to Speech API
3131
* @param {String} [options.token] - Auth token for CF services
3232
* @param {String} options.accessToken - IAM Access Token for RC services
3333
* @param {String} options.text text to speak
@@ -48,7 +48,7 @@ module.exports = function synthesize(options) {
4848
options.watsonToken = options.token;
4949
delete options.token;
5050
}
51-
var url = options.url || 'https://stream.watsonplatform.net/text-to-speech/api';
51+
var url = options.url || 'https://api.us-south.text-to-speech.watson.cloud.ibm.com';
5252
var audio = options.element || new Audio();
5353
audio.crossOrigin = 'anonymous';
5454
var queryParamsAllowed = ['voice', 'X-Watson-Learning-Opt-Out', 'text', 'watson-token', 'access_token', 'accept', 'customization_id'];

0 commit comments

Comments
 (0)