Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Basic example

Framework-free PHP. Two scripts against the ResponsiveVoice API.

Setup

composer install
export RESPONSIVEVOICE_API_KEY=your_key
export RESPONSIVEVOICE_API_SECRET=your_secret

Run

php voices.php              # list voices
php voices.php en-AU        # list voices for one language
php speak.php "Hello world" # synthesize to speech.mp3
php speak.php "G'day world" "Australian Male" out.mp3

Set RESPONSIVEVOICE_API_HOST to point at a different environment.

Synthesis returns raw bytes

v2TextSynthesizeGet() returns the audio as a string — write it wherever you need it:

$audio = $api->v2TextSynthesizeGet($text, $voice);
file_put_contents('speech.mp3', $audio);