diff --git a/docs/TEXT-TO-SPEECH.md b/docs/TEXT-TO-SPEECH.md index 97ea9e14..dfba5899 100644 --- a/docs/TEXT-TO-SPEECH.md +++ b/docs/TEXT-TO-SPEECH.md @@ -11,7 +11,7 @@ where the max length is around 1000 characters after the token is accounted for. Options: - text - the text to speak -- url - the Watson Text to Speech API URL (defaults to https://stream.watsonplatform.net/text-to-speech/api) +- url - the Watson Text to Speech API URL (defaults to https://api.us-south.text-to-speech.watson.cloud.ibm.com) - voice - the desired playback voice's name - see .getVoices(). Note that the voices are language-specific. - customization_id - GUID of a custom voice model - omit to use the voice with no customization. - autoPlay - set to false to prevent the audio from automatically playing diff --git a/examples/.env.example b/examples/.env.example index 9005f10a..768e4fdf 100644 --- a/examples/.env.example +++ b/examples/.env.example @@ -1,9 +1,9 @@ # Replace this if you are using a region specific service -SPEECH_TO_TEXT_URL=https://stream.watsonplatform.net/speech-to-text/api +SPEECH_TO_TEXT_URL=https://api.us-south.speech-to-text.watson.cloud.ibm.com # If your using IAM API keys use this and do not input credentials: SPEECH_TO_TEXT_IAM_APIKEY= # Replace this if you are using a region specific service -TEXT_TO_SPEECH_URL=https://stream.watsonplatform.net/text-to-speech/api +TEXT_TO_SPEECH_URL=https://api.us-south.text-to-speech.watson.cloud.ibm.com # If your using IAM API keys use this and do not input credentials: TEXT_TO_SPEECH_IAM_APIKEY= diff --git a/speech-to-text/get-models.js b/speech-to-text/get-models.js index 069c6f79..0bc9b917 100644 --- a/speech-to-text/get-models.js +++ b/speech-to-text/get-models.js @@ -24,7 +24,7 @@ ```js [{ - "url": "https://stream.watsonplatform.net/speech-to-text/api/v1/models/en-UK_BroadbandModel", + "url": "https://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/models/en-UK_BroadbandModel", "rate": 16000, "name": "en-UK_BroadbandModel", "language": "en-UK", @@ -37,7 +37,7 @@ * @todo define format in @return statement * @param {Object} options - * @param {String} options.url=https://stream.watsonplatform.net/speech-to-text/api URL for Watson Speech to Text API + * @param {String} options.url=https://api.us-south.speech-to-text.watson.cloud.ibm.com URL for Watson Speech to Text API * @param {String} options.token auth token for CF services * @param {String} options.accessToken IAM access token for RC services * @return {Promise} @@ -52,7 +52,7 @@ module.exports = function getModels(options) { accept: 'application/json' } }; - var url = options.url || 'https://stream.watsonplatform.net/speech-to-text/api'; + var url = options.url || 'https://api.us-south.speech-to-text.watson.cloud.ibm.com'; if (options.accessToken) { url = url + '/v1/models?access_token=' + options.accessToken; } else { diff --git a/speech-to-text/recognize-file.js b/speech-to-text/recognize-file.js index 1e6698f0..90da1608 100644 --- a/speech-to-text/recognize-file.js +++ b/speech-to-text/recognize-file.js @@ -36,7 +36,7 @@ var fetch = require('nodeify-fetch'); // like regular fetch, but with an extra m * (e.g. from a file , a dragdrop target, or an ajax request) * * @param {Object} options - Also passed to {MediaElementAudioStream} and to {RecognizeStream} - * @param {String} [options.url='wss://stream.watsonplatform.net/speech-to-text/api'] - Base URL for a service instance + * @param {String} [options.url='wss://api.us-south.speech-to-text.watson.cloud.ibm.com'] - Base URL for a service instance * @param {String} options.token - Auth Token for CF services - see https://github.com/watson-developer-cloud/node-sdk#authorization * @param {String} options.accessToken - IAM Access Token for RC services - see https://github.com/watson-developer-cloud/node-sdk#authorization * @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 --git a/speech-to-text/recognize-microphone.js b/speech-to-text/recognize-microphone.js index 328cbe6e..791ffaa6 100644 --- a/speech-to-text/recognize-microphone.js +++ b/speech-to-text/recognize-microphone.js @@ -46,7 +46,7 @@ var bitBucket = new Writable({ * @param {Object} options - Also passed to {RecognizeStream}, and {FormatStream} when applicable * @param {String} options.token - Auth Token for CF services - see https://github.com/watson-developer-cloud/node-sdk#authorization * @param {String} options.accessToken - IAM Access Token for RC services - see https://github.com/watson-developer-cloud/node-sdk#authorization - * @param {String} [options.url='wss://stream.watsonplatform.net/speech-to-text/api'] - Base URL for a service instance + * @param {String} [options.url='wss://api.us-south.speech-to-text.watson.cloud.ibm.com'] - Base URL for a service instance * @param {Boolean} [options.format=true] - pipe the text through a FormatStream which performs light formatting. Also controls smart_formatting option unless explicitly set. * @param {Boolean} [options.keepMicrophone=false] - keeps an internal reference to the microphone stream to reuse in subsequent calls (prevents multiple permissions dialogs in firefox) * @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 --git a/speech-to-text/recognize-stream.js b/speech-to-text/recognize-stream.js index 86f4b619..3c6fa6eb 100644 --- a/speech-to-text/recognize-stream.js +++ b/speech-to-text/recognize-stream.js @@ -34,7 +34,7 @@ var qs = require('../util/querystring.js'); * 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). * * @param {Options} options - * @param {string} [options.url] - Base url for service (default='wss://stream.watsonplatform.net/speech-to-text/api') + * @param {string} [options.url] - Base url for service (default='wss://api.us-south.speech-to-text.watson.cloud.ibm.com') * @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) * @param {boolean} [options.readableObjectMode] - Emit `result` objects instead of string Buffers for the `data` events. Does not affect input (which must be binary) * @param {boolean} [options.objectMode] - Alias for readableObjectMode @@ -158,7 +158,7 @@ RecognizeStream.prototype.initialize = function() { } var queryString = qs.stringify(queryParams); - var url = (options.url || 'wss://stream.watsonplatform.net/speech-to-text/api').replace(/^http/, 'ws') + '/v1/recognize?' + queryString; + var url = (options.url || 'wss://api.us-south.speech-to-text.watson.cloud.ibm.com').replace(/^http/, 'ws') + '/v1/recognize?' + queryString; // process opening payload params var openingMessageParamsAllowed = [ diff --git a/text-to-speech/get-voices.js b/text-to-speech/get-voices.js index bb5d58bd..ce437b0f 100644 --- a/text-to-speech/get-voices.js +++ b/text-to-speech/get-voices.js @@ -28,7 +28,7 @@ "language": "en-US", "customizable": true, "gender": "male", - "url": "https://stream.watsonplatform.net/text-to-speech/api/v1/voices/en-US_MichaelVoice", + "url": "https://api.us-south.text-to-speech.watson.cloud.ibm.com/v1/voices/en-US_MichaelVoice", "description": "Michael: American English male voice." }, //... @@ -38,7 +38,7 @@ * @todo define format in @return statement * @param {Object} options - * @param {String} options.url=https://stream.watsonplatform.net/text-to-speech/api URL for Watson Text to Speech API + * @param {String} options.url=https://api.us-south.text-to-speech.watson.cloud.ibm.com URL for Watson Text to Speech API * @param {String} options.token auth token for CF services * @param {String} options.accessToken IAM access token for RC services * @return {Promise.} @@ -53,7 +53,7 @@ module.exports = function getVoices(options) { accept: 'application/json' } }; - var url = options.url || 'https://stream.watsonplatform.net/text-to-speech/api'; + var url = options.url || 'https://api.us-south.text-to-speech.watson.cloud.ibm.com'; if (options.accessToken) { url = url + '/v1/voices?access_token=' + options.accessToken; } else { diff --git a/text-to-speech/synthesize.js b/text-to-speech/synthesize.js index a4821a69..22b9feb3 100644 --- a/text-to-speech/synthesize.js +++ b/text-to-speech/synthesize.js @@ -27,7 +27,7 @@ var qs = require('../util/querystring.js'); * Creates and returns a HTML5 `