Aliyun Speech Synthesis WS
AI-generatedOverview
This node uses Alibaba's Natural Language Speech (NLS) WebSocket SDK to convert text into speech audio. It connects to Alibaba's speech synthesis service via WebSocket, sending the input text and receiving synthesized audio in real-time. This is useful for automating voice generation tasks such as creating audio notifications, voice assistants, or accessibility features.
Practical examples:
- Generating spoken versions of text content for podcasts or audiobooks.
- Creating dynamic voice alerts in customer support workflows.
- Converting chat messages or notifications into audio for hands-free applications.
Properties
| Name | Meaning |
|---|---|
| App Key | The application key used to authenticate with Alibaba's speech synthesis service. |
| Token | The authentication token required to access the Alibaba NLS WebSocket API. |
| Text | The text string that will be converted into speech audio. |
| Voice | The voice model to use for synthesis. Default is "aixia". |
| Format | The audio output format. Options: Mp3, Wav, Pcm. |
| Sample Rate | The sample rate of the output audio in Hz. Default is 16000 (16 kHz). |
Output
The node outputs binary audio data corresponding to the synthesized speech. Each item in the output contains:
json: An empty JSON object (no additional metadata).binary.audio: The synthesized audio file prepared as binary data, named based on the first 10 characters of the input text (sanitized), appended with the index and appropriate file extension matching the selected format.
This allows downstream nodes to handle or save the audio files directly.
Dependencies
- Requires an active Alibaba Cloud account with access to the Natural Language Speech (NLS) WebSocket service.
- Needs valid credentials: an application key and a token for authentication.
- The node depends on an internal utility function (
synthesizeWithWebSocket) from the bundledAliyunSpeechWS.utilsmodule to perform the WebSocket communication and audio synthesis.
Troubleshooting
- Authentication errors: If the app key or token is invalid or expired, the node will fail to connect. Ensure credentials are correct and have not expired.
- Connection issues: Network problems or firewall restrictions may block WebSocket connections. Verify network settings allow outbound WebSocket traffic.
- Unsupported audio format: Selecting an unsupported format might cause errors. Use one of the provided options: mp3, wav, or pcm.
- Empty or invalid text: Providing empty or malformed text input may result in no audio output or errors. Ensure the text property is properly set.
- Large text inputs: Very long texts might cause delays or timeouts. Consider splitting large texts into smaller chunks.