Skip to content

Commit 13ab63f

Browse files
feat(tts): add new params to websocket function
1 parent b9fad7b commit 13ab63f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/synthesize-stream.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2020.
2+
* (C) Copyright IBM Corp. 2018, 2023.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -62,6 +62,8 @@ class SynthesizeStream extends Readable {
6262
* @param {string} [options.watsonToken] - Valid Watson authentication token (for Cloud Foundry)
6363
* @param {string} [options.voice] - The voice to use for the synthesis (default='en-US_MichaelVoice')
6464
* @param {string} [options.customizationId] - The customization ID (GUID) of a custom voice model that is to be used for the synthesis
65+
* @param {number} [options.ratePercentage] - The percentage change from the default speaking rate of the voice that is used for speech synthesis.
66+
* @param {number} [options.pitchPercentage] - The percentage change from the default speaking pitch of the voice that is used for speech synthesis.
6567
* @param {boolean} [options.xWatsonLearningOptOut] - Indicates whether IBM can use data that is sent over the connection to improve the service for future users (default=false)
6668
* @param {string} [options.xWatsonMetadata] - Associates a customer ID with all data that is passed over the connection. The parameter accepts the argument customer_id={id}, where {id} is a random or generic string that is to be associated with the data
6769
* @constructor
@@ -82,6 +84,8 @@ class SynthesizeStream extends Readable {
8284
'watson-token',
8385
'voice',
8486
'customization_id',
87+
'rate_percentage',
88+
'pitch_percentage',
8589
'x-watson-learning-opt-out',
8690
'x-watson-metadata',
8791
];

text-to-speech/v1.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ namespace TextToSpeechV1 {
150150
voice?: string;
151151
customizationId?: string;
152152
spellOutMode?: string;
153+
ratePercentage?: number;
154+
pitchPercentage?: number;
153155
xWatsonLearningOptOut?: boolean;
154156
xWatsonMetadata?: string;
155157
}

0 commit comments

Comments
 (0)