PlayHT Integration with SmythOS
Want to add a voice to your automated workflows? Connect PlayHT to SmythOS and empower your agents to generate high-quality, AI-powered speech from any text input.
List of PlayHT Components
Quickly compare PlayHT components by what they do and their key I/O. Click any component name to jump directly to its detailed guide.
Component | Action | What it Does | Inputs | Key Outputs | Use Case |
---|---|---|---|---|---|
PlayHT 2.0 - TTS | Generate | Initiates a high-quality, emotional text-to-speech conversion job. | required text , voice_id | id | Creating expressive voiceovers for videos. |
PlayHT 1.0 - TTS | Generate | Initiates a standard text-to-speech conversion job. | required text , voice_id | id | Generating simple audio notifications or alerts. |
Get Output | Fetch | Retrieves the result (audio URL) of a completed TTS job. | required id | URL | The second step to get the final audio file. |
Prerequisites
Before you begin, please ensure you have the following:
- An active SmythOS account. (Sign up here).
- A PlayHT account.
- Your PlayHT User ID and Secret Key.
Getting Started With PlayHT
The connection between SmythOS and PlayHT is configured using your User ID and a secure Secret Key.
Step 1: Get Your PlayHT Credentials
- Log in to your PlayHT Studio.
- On the API Access page, you will find your User ID and Secret Key.
- Copy both of these values.
Step 2: Store Your Credentials in SmythOS Vault
Your User ID and Secret Key are sensitive credentials. Use the SmythOS Vault
to store them securely.
- In your SmythOS dashboard, navigate to the Vault.
- Create a new secret for your
User ID
and another for yourSecret Key
. Give them memorable names, likeplayht_user_id
andplayht_secret_key
. - For more details, see the Vault Documentation.
Step 3: Configure a PlayHT Component
- In your SmythOS agent graph, drag and drop any PlayHT component.
- Click the component to open its Settings panel.
- In the
User ID
andSecret Key
fields, select the corresponding secrets you saved in the Vault. - Your connection is now configured for that component.
Which PlayHT Component Should I Use?
If you need to… | Workflow Steps | Use these Components | Why these? |
---|---|---|---|
Generate high-quality, emotional speech | 1. Start Job 2. Fetch Result | PlayHT 2.0 - TTS → Get Output | The 2.0 TTS engine offers superior quality and emotional control, but requires a two-step, asynchronous process. |
Generate standard speech quickly | 1. Start Job 2. Fetch Result | PlayHT 1.0 - TTS → Get Output | The 1.0 TTS engine is suitable for basic voice generation without the need for advanced emotional tones. |
Retrieve a previously generated audio file | Fetch Result | Get Output | This is the essential second step to get the audio URL from any TTS job you've started. |
Component Details
This section provides detailed information for each PlayHT component.
PlayHT 2.0 - TTS
Initiates a text-to-speech conversion job using PlayHT's advanced v2.0 engine, which supports emotional tones. This is an asynchronous operation.
Component-Specific Settings
- Output Format: Choose the audio format (
mp3
,wav
,ogg
, etc.). - Quality: Select the output quality, from
draft
topremium
. - Emotion: Select a specific emotional tone for the voice (e.g.,
female_happy
,male_angry
). - Speed, Sample Rate, Voice Guidance, Style Guidance: Fine-tune the voice performance with these sliders.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
text | string | Yes | The text content to convert into speech. |
voice_id | string | Yes | The ID of the voice to use. You can find voice IDs in your PlayHT Studio. |
Outputs
Field | Type | Description |
---|---|---|
id | string | The unique ID of the conversion job. This is crucial for the next step. |
Response | object | The raw JSON response from the PlayHT API confirming the job was started. |
Headers | object | The HTTP headers from the API response. |
{
"component": "playht.playht20Tts",
"text": "Wow, I can't believe SmythOS can automate this!",
"voice_id": "s3_voice_id_example"
}
Get Output
Retrieves the result of a TTS conversion job that has been initiated by either the v1.0 or v2.0 TTS component.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
id | string | Yes | The unique ID of the conversion job, obtained from the output of a TTS component. |
Outputs
Field | Type | Description |
---|---|---|
URL | string | The direct URL to the generated audio file once processing is complete. |
Response | object | The raw JSON response from the API, which includes the status of the job and the URL. |
Headers | object | The HTTP headers from the API response. |
{
"component": "playht.getOutput",
"id": "tts-job-id-from-previous-step"
}
PlayHT 1.0 - TTS
Initiates a text-to-speech conversion job using PlayHT's standard v1.0 engine.
Component-Specific Settings
- Output Format: Choose the audio format (
mp3
,wav
, etc.). - Quality: Select the output quality, from
draft
topremium
. - Speed: Control the playback speed of the audio.
- Sample Rate: Specify the sample rate for the audio file.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
text | string | Yes | The text content to convert into speech. |
voice_id | string | Yes | The ID of the voice to use. |
Outputs
Field | Type | Description |
---|---|---|
id | string | The unique ID of the conversion job, to be used with the "Get Output" component. |
Response | object | The raw JSON response from the PlayHT API. |
Headers | object | The HTTP headers from the API response. |
{
"component": "playht.playht10Tts",
"text": "System alert. Server utilization has reached 90 percent.",
"voice_id": "s3_voice_id_example"
}
Best Practices & Advanced Tips
- Secure Your Credentials: Always store your
User ID
andSecret Key
in the SmythOSVault
. - Master the Asynchronous Flow: The key to using this integration effectively is the two-step process. First, call a TTS component to get a job
id
. Second, use theGet Output
component (potentially in a loop with a delay) to fetch the final audioURL
. - Experiment with Voices and Settings: PlayHT offers a huge variety of voices. Spend time in the PlayHT Studio to find the ones that best fit your brand. Tweak the speed, quality, and emotion settings to get the perfect performance.
- Manage Your Quota: Text-to-speech conversion consumes characters from your PlayHT plan. Be mindful of the length of the text you are converting, especially in high-volume automated workflows.
Troubleshooting Common Issues
-
Error:
401 Unauthorized
- Cause: The
User ID
orSecret Key
is incorrect or missing. - Solution: Verify that your credentials in the SmythOS Vault are correct and match those on your PlayHT API Access page.
- Cause: The
-
"Get Output" returns a "Pending" status
- Cause: The audio generation job is not yet complete.
- Solution: This is normal. Add a delay (e.g., 5-10 seconds) in your agent between the TTS component and the
Get Output
component. For long texts, you may need a longer delay or a looping mechanism.
-
Error:
402 Payment Required
- Cause: You have exceeded your character quota for the month or have an issue with your PlayHT subscription.
- Solution: Check your account status and usage in your PlayHT dashboard.
-
Poor Audio Quality or Incorrect Emotion
- Cause: The selected settings may not be optimal for the voice or text.
- Solution: Try a different
Quality
setting in the component. Adjust theStyle Guidance
andVoice Guidance
sliders in the v2.0 component to fine-tune the performance.
What's Next?
You are now ready to build powerful voice-enabled applications with the SmythOS PlayHT Integration!
Consider these ideas:
-
Build an Agent That...
- Takes the text from a scraped web article (ScrapingBee), converts it to audio with PlayHT, and saves the MP3 file to OneDrive.
- Generates a personalized daily news briefing by getting headlines from NewsAPI and reading them aloud.
- Creates dynamic voice responses for a chatbot, using an LLM like OpenRouter to generate the text and PlayHT to generate the audio.
-
Explore Other Integrations:
- Connect your agent to a telephony service to make automated calls using the generated speech.
- Use PlayHT to create audio versions of your marketing emails, and send them out as part of a campaign.