You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -49,6 +58,31 @@ class SynthesizeStream extends Readable {
49
58
privateinitialized: boolean;
50
59
privateauthenticated: boolean;
51
60
61
+
62
+
/**
63
+
* pipe()-able Node.js Readable stream - accepts text and emits binary audio data in its 'message' events
64
+
*
65
+
* Uses WebSockets under the hood.
66
+
*
67
+
*
68
+
* Note that the WebSocket connection is not established until the first chunk of data is recieved. This allows for IAM token request management by the SDK.
69
+
*
70
+
* @param {Object} options
71
+
* @param {String} options.text - The text that us to be synthesized. Provide plain text or text that is annotated with SSML. SSML input can include the SSML <mark> element. Pass a maximum of 5 KB of text.
72
+
* @param {String} options.accept - The requested audio format (MIME type) of the audio.
73
+
* @param {String[]} [options.timings] - An array that specifies whether the service is to return word timing information for all strings of the input text
74
+
* @param {String} [options.voice='en-US_MichaelVoice'] - The voice that is to be used for the synthesis.
75
+
* @param {String} [options.customization_id] - The customization ID (GUID) of a custom voice model that is to be used for the synthesis.
76
+
* @param {String} [options.url='wss://stream.watsonplatform.net/speech-to-text/api'] base URL for service
* @param {Object} [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)
79
+
* @param {Boolean} [options.x-watson-learning-opt-out=false] - set to true to opt-out of allowing Watson to use this request to improve it's services
80
+
* @param {String} [options.x-watson-metadata] - Associates a customer ID with data that is passed over the connection.
81
+
* @param {IamTokenManagerV1} [options.token_manager] - Token manager for authenticating with IAM
82
+
* @param {Boolean} [options.rejectUnauthorized] - If true, disable SSL verification for the WebSocket connection
83
+
*
84
+
* @constructor
85
+
*/
52
86
constructor(options){
53
87
super(options);
54
88
this.options=options;
@@ -144,6 +178,15 @@ class SynthesizeStream extends Readable {
144
178
});
145
179
}
146
180
181
+
/**
182
+
* This function retrieves an IAM access token and stores it in the
183
+
* request header before calling the callback function, which will
0 commit comments