Skip to content

Commit d30bb25

Browse files
fix(tts): remove unnecessary filename param
1 parent 1c912cd commit d30bb25

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

test/integration/text-to-speech.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ describe('text to speech_integration', () => {
109109
prompt_text: 'Hello, how are you today?',
110110
},
111111
file: fs.createReadStream(path.join(__dirname, '../resources/tts_audio.wav')),
112-
filename: 'tts_audio.wav',
113112
};
114113

115114
const res = await textToSpeech.addCustomPrompt(params);

test/unit/text-to-speech.v1.test.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,13 +1187,11 @@ describe('TextToSpeechV1', () => {
11871187
const promptId = 'testString';
11881188
const metadata = promptMetadataModel;
11891189
const file = Buffer.from('This is a mock file.');
1190-
const filename = 'testString';
11911190
const params = {
11921191
customizationId: customizationId,
11931192
promptId: promptId,
11941193
metadata: metadata,
11951194
file: file,
1196-
filename: filename,
11971195
};
11981196

11991197
const addCustomPromptResult = textToSpeechService.addCustomPrompt(params);
@@ -1216,7 +1214,6 @@ describe('TextToSpeechV1', () => {
12161214
checkMediaHeaders(createRequestMock, expectedAccept, expectedContentType);
12171215
expect(options.formData['metadata']).toEqual(metadata);
12181216
expect(options.formData['file'].data).toEqual(file);
1219-
expect(options.formData['file'].filename).toEqual(filename);
12201217
expect(options.formData['file'].contentType).toEqual('audio/wav');
12211218
expect(options.path['customization_id']).toEqual(customizationId);
12221219
expect(options.path['prompt_id']).toEqual(promptId);
@@ -1228,15 +1225,13 @@ describe('TextToSpeechV1', () => {
12281225
const promptId = 'testString';
12291226
const metadata = promptMetadataModel;
12301227
const file = Buffer.from('This is a mock file.');
1231-
const filename = 'testString';
12321228
const userAccept = 'fake/accept';
12331229
const userContentType = 'fake/contentType';
12341230
const params = {
12351231
customizationId,
12361232
promptId,
12371233
metadata,
12381234
file,
1239-
filename,
12401235
headers: {
12411236
Accept: userAccept,
12421237
'Content-Type': userContentType,

text-to-speech/v1-generated.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,13 +1139,12 @@ class TextToSpeechV1 extends BaseService {
11391139
* * The prompt audio must be in WAV format and must have a minimum sampling rate of 16 kHz. The service accepts audio
11401140
* with higher sampling rates. The service transcodes all audio to 16 kHz before processing it.
11411141
* * The length of the prompt audio is limited to 30 seconds.
1142-
* @param {string} params.filename - The filename for file.
11431142
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
11441143
* @returns {Promise<TextToSpeechV1.Response<TextToSpeechV1.Prompt>>}
11451144
*/
11461145
public addCustomPrompt(params: TextToSpeechV1.AddCustomPromptParams): Promise<TextToSpeechV1.Response<TextToSpeechV1.Prompt>> {
11471146
const _params = Object.assign({}, params);
1148-
const requiredParams = ['customizationId', 'promptId', 'metadata', 'file', 'filename'];
1147+
const requiredParams = ['customizationId', 'promptId', 'metadata', 'file'];
11491148

11501149
const missingParams = getMissingParams(_params, requiredParams);
11511150
if (missingParams) {
@@ -1156,7 +1155,6 @@ class TextToSpeechV1 extends BaseService {
11561155
'metadata': _params.metadata,
11571156
'file': {
11581157
data: _params.file,
1159-
filename: _params.filename,
11601158
contentType: 'audio/wav'
11611159
}
11621160
};
@@ -2109,8 +2107,6 @@ namespace TextToSpeechV1 {
21092107
* * The length of the prompt audio is limited to 30 seconds.
21102108
*/
21112109
file: NodeJS.ReadableStream|Buffer;
2112-
/** The filename for file. */
2113-
filename: string;
21142110
headers?: OutgoingHttpHeaders;
21152111
}
21162112

0 commit comments

Comments
 (0)