Framework-free PHP. Two scripts against the ResponsiveVoice API.
composer install
export RESPONSIVEVOICE_API_KEY=your_key
export RESPONSIVEVOICE_API_SECRET=your_secretphp 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.mp3Set RESPONSIVEVOICE_API_HOST to point at a different environment.
v2TextSynthesizeGet() returns the audio as a string — write it wherever you
need it:
$audio = $api->v2TextSynthesizeGet($text, $voice);
file_put_contents('speech.mp3', $audio);