mmir.env.media.WebAudioTextToSpeech
Members
-
readonly_basePluginName
-
- Default Value:
- "audiotts"
-
readonly_defaultImplFile
-
Default implementation for WebAudioTTS: MARY TTS
- Default Value:
- "ttsMary.js"
-
protected_loggermmir.tools.Logger
-
Will be set when specific implementation is initialized.
- See:
-
initImpl
-
protected_pluginName
-
Will be set/"overwritten" by specific implementation.
- See:
-
initImpl
-
bufferSize
-
number of audio-objects that should be pre-fetched/buffered when in sentence-mode.
-
protectedcreateAudio
-
Will be set/"overwritten" by specific implementation.
-
protecteddestroySynthesizer
-
Will be set/"overwritten" by specific implementation.
-
protectedgetLanguages
-
Will be set/"overwritten" by specific implementation.
-
protectedgetVoices
-
Will be set/"overwritten" by specific implementation.
-
protectedinitSynthesizer
-
Will be set/"overwritten" by specific implementation.
Methods
-
staticmmir.env.media.WebAudioTextToSpeech.initialize()
-
-
cancelSpeech()
-
Cancel current synthesis.
-
destroySpeech()
-
destroy speech synthesizer instance and freeing up system resources. NOTE: may not be supported by all synthesizer implementations (e.g. if the impl. does not block system resources etc)
-
getSpeechLanguages()
-
get list of supported languages for TTS (may not be supported by all plugins).
-
getVoices(options, successCallback, failureCallback)
-
get list of supported voices for TTS (may not be supported by all plugins).
Name Type Description optionsString | VoiceOptions optional OPTIONAL if String, the language code (optionally with country code) for which the voices should be listed. if VoiceOptions: options.language: {String} OPTIONAL the language code options.details: {Boolean} OPTIONAL if TRUE the returned list contains VoiceDetail objects with {name: STRING, language: STRING, gender: "female" | "male" | "unknown"} successCallbackfunction the success callback: successCallback(Array ) failureCallbackfunction the error callback: failureCallback(err) -
setTextToSpeechVolume(newValue)
-
Set the volume for the speech synthesis (text-to-speech).
Name Type Description newValueNumber TODO specify format / range -
textToSpeech()
-
- Deprecated
- use
ttsinstead
- use
-
tts(options, onPlayedCallback, failureCallback, onReadyCallback)
-
Synthesizes ("read out loud") text.
Name Type Description optionsString | Array.<String> | PlainObject optional OPTIONAL if StringorArrayofStrings synthesizes the text of the String(s).
For an Array: each entry is interpreted as "sentence"; after each sentence, a short pause is inserted before synthesizing the the next sentence
for aPlainObject, the following properties should be used:{ text: String | String[], text that should be read aloud , pauseDuration: OPTIONAL Number, the length of the pauses between sentences (i.e. for String Arrays) in milliseconds , language: OPTIONAL String, the language for synthesis (if omitted, the current language setting is used) , voice: OPTIONAL String, the voice (language specific) for synthesis; NOTE that the specific available voices depend on the TTS engine , success: OPTIONAL Function, the on-playing-completed callback (see arg onPlayedCallback) , error: OPTIONAL Function, the error callback (see arg failureCallback) , ready: OPTIONAL Function, the audio-ready callback (see arg onReadyCallback) }onPlayedCallbackfunction optional OPTIONAL callback that is invoked when the audio of the speech synthesis finished playing: onPlayedCallback()
NOTE: if used in combination withoptions.success, this argument will supersede the optionsfailureCallbackfunction optional OPTIONAL callback that is invoked in case an error occurred: failureCallback(error: String | Error)
NOTE: if used in combination withoptions.error, this argument will supersede the optionsonReadyCallbackfunction optional OPTIONAL callback that is invoked when audio becomes ready / is starting to play. If, after the first invocation, audio is paused due to preparing the next audio, then the callback will be invoked with false, and then withtrue(as first argument), when the audio becomes ready again, i.e. the callback signature is:onReadyCallback(isReady: Boolean, audio: IAudio)
NOTE: if used in combination withoptions.ready, this argument will supersede the options