speech-stream
Text-to-speech using streams. Stream configuration data, text. Output audio buffers.
API
The API is very minimal. You just create a transform stream that takes in voice configuration data and outputs
`SpeechStream([default_voice])``
Creates a new SpeechStream and optionally takes a default voice to use. Documentation on the voice options can be found here.
parameters
[default_voice]
: Optional Object containing voice configuration. If this isn't provided, a random is generated using randomvoice.
returns
SpeechStream
: A Duplex stream which takes in objects that contain amessage
property which is a string, and optionally avoice
property which contains the aforementioned voice configuration data.
Example:
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.