Learn how to create engaging AI-powered podcasts using PlayAI
Set up environment variables
Create a new script
Configure the model and voices
Add your podcast transcript
Configure the API payload
Send the request and monitor progress
model
: Specifies the PlayAI’s Dialog 1.0 model to be used. Here, PlayDialog
supports multi-turn conversation generation.
text
: Contains the scripted conversation, with each turn prefixed by the speaker’s name (e.g., "Country Mouse"
& "Town Mouse"
).
voice
: URL path to the voice manifest for the first speaker.
voice_2
: URL path to the voice manifest for the second speaker.
turn_prefix
/ turn_prefix_2
: Used to specify each speaker’s dialogue turns within the text
field. For example: turn_prefix
says Country Mouse
to indicate the position where Speaker 1’s dialogue and turn_prefix_2
says Town Mouse
that indicates the position where Speaker 2’s dialogue parts are.
output_format
: Format for the generated audio file, typically wav
or mp3
.
country_mouse.py
then Run the code using python3 country_mouse.py
pointing your terminal to the directory where the country_mouse.py
file is stored. This will save the dialogue.wav
in the same working directory.
AUTHORIZATION token
and X-USER-ID
are required for authentication, which you’ll need to replace with your own credentials.
Each line of dialogue is labeled by character name (e.g., “Country Mouse
” or “Town Mouse
”) to simulate a natural conversation. The script assigns a unique voice to each character using voice
and voice2
. On a successful API call, the generated audio is saved as dialogue.wav
. Any errors are reported with status details.
To run the script:
text
with your scripted conversation
dialogue.wav
, will be saved in the current directory, capturing the dialogue as configured.
API key
and user ID
. Ensure the AUTHORIZATION
header includes “Bearer ” followed by your token.
model
name is PlayDialog