Sherpa TTS Node
SherpaTTS node is responsible for converting text into natural-sounding speech using advanced text-to-speech algorithms.
Configuration
Name | Type | Description |
---|---|---|
text | String | Initial text to render. |
Values
This object does not provide any values.
Actions
Name | Parameters | Description |
---|---|---|
synthesize | text: String | Starts rendering of text as audio. |
loadModel | modelPath: String tokensPath: String dataPath: String | Loads a Sherpa model from the provided paths. |
Events
This object does not provide any events.
Example
This example generates speech audio and renders it in real-time on the device's speaker.
- JSON
{
"type": "RealTimeGraphRenderer",
"config": {
"graph": {
"config": {
"sampleRate": 16000,
"bufferSize": 512
},
"nodes": [
{
"id": "ttsNode",
"type": "Sherpa.SherpaTTSNode"
},
{
"id": "monoToMultiChannelNode",
"type": "MonoToMultiChannel"
}
],
"connections": [
{
"sourceNode": "ttsNode",
"destinationNode": "monoToMultiChannelNode"
},
{
"sourceNode": "monoToMultiChannelNode",
"destinationNode": "outputNode"
}
]
}
}
}
To generate speech with the TTS node, call the synthesize
action and provide the desired text as a parameter.
- C++
auto result = SwitchboardV3::callAction("ttsNode", "synthesize", { { "text", text } });