-
Notifications
You must be signed in to change notification settings - Fork 8
Speech Synthesis
Lauri-Matti Parppei edited this page Mar 14, 2022
·
1 revision
Beat includes preliminary support for text-to-speech. Functionality will be expanded in future.
NOTE: The plugin has to reside in memory to use text-to-speech methods. To make it resident, you need to either register a window, observer (like Beat.onTextChange()
) or a widget.
let speech = Beat.speech()
The object has following properties:
.rate
— speaking speed
.volume
— volume (from 0.0
to 1.0
)
.language
— speaking language identifier (ie. en
), defaults to system language
.pitchMultiplier
— speaker pitch
Speak a string:
speech.speak("Hello world")
Speech will run in the background. You can stop the synthesis at any time:
speech.stop()