albo-vieira/google-speech-tts

这是一个用于从文本生成音频的Google翻译包装器。

dev-master 2017-02-16 20:38 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:25:44 UTC


README

这是一个从给定文本生成音频的Google翻译包装器。

composer require albo-vieira/google-speech-tts dev-master

use GoogleSpeech\TextToSpeech;

$speech = new TextToSpeech();
$speech
    ->withLanguage('en-us')
    ->inPath('../audios');

for($i=0;$i<10;$i++){
    $speech->withName('output' . $i);
    $speech->download('I would try something like that ' . $i);
    
    echo 'File generated:' . $speech->getCompletePath() . '<br>';
}