Text 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.
speak(text)
| parameter | Type | Description |
|---|---|---|
| text | string | The text to convert to speech |
Example Implementation
- The following code demonstrates how to convert text to speech and play it during a call:
- Node.js
- Python
const { PiopiyAction } = require("piopiy");
const action = new PiopiyAction();
action.speak("Hello, Welcome to Telecmi")
from piopiy import Action
# Create an instance of the Action class
action = Action()
action.speak("Hello, Welcome to Telecmi")