Skip to content

Commit 3139428

Browse files
added optional parameter 'customization_id' to Text-To-Speech synthesize() function
1 parent 3b34b37 commit 3139428

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ where the max length is around 1000 characters after the token is accounted for.
6969
Options:
7070
* text - the text to speak
7171
* voice - the desired playback voice's name - see .getVoices(). Note that the voices are language-specific.
72+
* customization_id - GUID of a custom voice model - omit to use the voice with no customization.
7273
* autoPlay - set to false to prevent the audio from automatically playing
7374

7475
Relies on browser audio support: should work reliably in Chrome and Firefox on desktop and Android. Edge works with a little help. Safari and all iOS browsers do not seem to work yet.

text-to-speech/synthesize.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
var pick = require('object.pick');
1818
var qs = require('../util/querystring.js');
1919

20-
var QUERY_PARAMS_ALLOWED = ['voice', 'X-WDC-PL-OPT-OUT', 'X-Watson-Learning-Opt-Out', 'text', 'watson-token', 'accept'];
20+
var QUERY_PARAMS_ALLOWED = ['voice', 'X-WDC-PL-OPT-OUT', 'X-Watson-Learning-Opt-Out', 'text', 'watson-token', 'accept', 'customization_id'];
2121

2222
/**
2323
* @module watson-speech/text-to-speech/synthesize
@@ -32,6 +32,7 @@ var QUERY_PARAMS_ALLOWED = ['voice', 'X-WDC-PL-OPT-OUT', 'X-Watson-Learning-Opt-
3232
* @param {String} options.token auth token
3333
* @param {String} options.text text to speak
3434
* @param {String} [options.voice=en-US_MichaelVoice] what voice to use - call getVoices() for a complete list.
35+
* @param {String} [options.customization_id] GUID of a custom voice model. Omit to use the voice with no customization.
3536
* @param {String} [options.accept] - specify desired audio format. Leave unset to allow (most) browsers to automatically negotiate an ideal format.
3637
* @param {Number} [options.X-Watson-Learning-Opt-Out=0] set to 1 to opt-out of allowing Watson to use this request to improve it's services
3738
* @param {Boolean} [options.autoPlay=true] automatically play the audio

0 commit comments

Comments
 (0)