'default', 'version' => '2016-06-10', 'region' => 'us-east-2' ]); $text = 'This is a sample text to be synthesized.'; $format = 'mp3'; //json|mp3|ogg_vorbis|pcm $S3Bucket = 'bucketName'; $voice = 'Joanna'; try { $result = $client->startSpeechSynthesisTask([ 'Text' => $text, 'OutputFormat' => $format, 'OutputS3BucketName' => $S3Bucket, 'VoiceId' => $voice, ]); $taskId = $result['SynthesisTask']['TaskId']; print('

Task started: ' . $taskId . '

'); var_dump($result); } catch (AwsException $e) { // output error message if fails echo $e->getMessage(); echo "\n"; } // snippet-end:[polly.php.synthesize_speech_task.main] // snippet-end:[polly.php.synthesize_speech_task.complete]