Text-to-speech using streams. Stream configuration data, text. Output audio buffers.
The API is very minimal. You just create a transform stream that takes in voice configuration data and outputs
Creates a new SpeechStream and optionally takes a default voice to use. Documentation on the voice options can be found here.
[default_voice]: Optional Object containing voice configuration. If this isn't provided, a random is generated using randomvoice.
SpeechStream: A Duplex stream which takes in objects that contain a
messageproperty which is a string, and optionally a
voiceproperty which contains the aforementioned voice configuration data.
var streamArray = ;var makeProp = ;var speechStream = ;var fs = ;;
Note: this example doesn't work well with multiple messages since it'll concatenate the buffer data together. A better use would be to pipe this into something that either saves everything or outputs to your speakers.