I've tried to find answers online, but couldn't find anything that helped me...
I am trying to convert a PCM stream into a WAV file using PHP (7.2) and save it on the server.
Specifically, I am generating speech via Amazon Polly with the below code:
try {
$result = $client->synthesizeSpeech([
'Text' => 'Dies ist ein Test.',
'OutputFormat' => 'pcm',
'SampleRate' => '8000',
'VoiceId' => 'Hans'
]);
$resultData = $result->get('AudioStream')->getContents();
}
I need a WAV file for use with different code later on.
Many thanks for your help!