I am trying to send some text to AWS Polly to convert to speech and then save that mp3 file to S3. That part seems to work now.
// Send text to AWS Polly $client_polly = new Aws\Polly\PollyClient([ 'region' => 'us-west-2', 'version' => 'latest', 'credentials' => [ 'key' => $aws_useKey, 'secret' => $aws_secret, ] ]); $text = 'Test. Test. This is a sample text to be synthesized.'; $voice = 'Matthew'; $result_polly = $client_polly->startSpeechSynthesisTask([ 'Text' => $text, 'TextType' => 'text', 'OutputFormat' => 'mp3', 'OutputS3BucketName' => $aws_bucket, 'OutputS3KeyPrefix' => 'files/audio/, 'VoiceId' => $voice, 'ACL' => 'public-read' ]); echo $result_polly['ObjectURL'];
I'm also trying to accomplish couple other things:
Make mp3 file publicly accessible. Currently I have to go to AWS console to click "Make Public" button. It seems that 'ACL' => 'public-read' doesn't work for me
I need to return full URL of the mp3 file. For some reason $result_polly['ObjectURL']; doesn't get any value.
What am I missing?