Text to speech
The speak action will read our text to speech to the caller, which is useful for converting dynamic text into a human-sounding voice. Instead of recording the complete audio file using a human voice, text to speech allows the developers to save time.
- Curl
- Node.js
- Python
Speak action JSON
[
{
action: "speak",
text: "Hello. Your one time password is. 9. 8. 9. 7"
}
]
Parameters type and description
Parameter | Type | Description |
---|---|---|
*action | string | The PCMO action to control the flow of the call. |
*text | string | The text content to convert as voice. |
Note
All above parameters are mandatory.
To perform text-to-speech during a call in PCMO, you can use the speak()
method from the PiopiyAction
class. This method converts the provided text into speech and plays it during the call.
const { PiopiyAction } = require("piopiy");
const action = new PiopiyAction();
const text = "Hello, Welcome to Telecmi";
action.speak(text);
Parameters type and description
Parameter | Type | Description |
---|---|---|
text | string | The text to convert to speech. |
To perform text-to-speech during a call in PCMO, you can use the speak()
method from the PiopiyAction
class. This method converts the provided text into speech and plays it during the call.
from piopiy import Action
action = Action()
text = "Hello, Welcome to Telecmi"
action.speak(text)
Parameters type and description
Parameter | Type | Description |
---|---|---|
text | string | The text to convert to speech. |