# Google Cloud Text-to-Speech V1 generated client for PHP ### Sample ```php require __DIR__ . '/vendor/autoload.php'; use Google\Cloud\TextToSpeech\V1\AudioConfig; use Google\Cloud\TextToSpeech\V1\AudioEncoding; use Google\Cloud\TextToSpeech\V1\SynthesisInput; use Google\Cloud\TextToSpeech\V1\TextToSpeechClient; use Google\Cloud\TextToSpeech\V1\VoiceSelectionParams; $textToSpeechClient = new TextToSpeechClient(); $input = new SynthesisInput(); $input->setText('Japan\'s national soccer team won against Colombia!'); $voice = new VoiceSelectionParams(); $voice->setLanguageCode('en-US'); $audioConfig = new AudioConfig(); $audioConfig->setAudioEncoding(AudioEncoding::MP3); $resp = $textToSpeechClient->synthesizeSpeech($input, $voice, $audioConfig); file_put_contents('test.mp3', $resp->getAudioContent()); ```
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Gapic | Folder | 0755 |
|
|
resources | Folder | 0755 |
|
|
AudioConfig.php | File | 13.02 KB | 0644 |
|
AudioEncoding.php | File | 2.2 KB | 0644 |
|
ListVoicesRequest.php | File | 3.7 KB | 0644 |
|
ListVoicesResponse.php | File | 1.91 KB | 0644 |
|
README.md | File | 821 B | 0644 |
|
SsmlVoiceGender.php | File | 2.1 KB | 0644 |
|
SynthesisInput.php | File | 3.03 KB | 0644 |
|
SynthesizeSpeechRequest.php | File | 4.34 KB | 0644 |
|
SynthesizeSpeechResponse.php | File | 2.62 KB | 0644 |
|
TextToSpeechClient.php | File | 1.18 KB | 0644 |
|
TextToSpeechGrpcClient.php | File | 2.33 KB | 0644 |
|
Voice.php | File | 5.17 KB | 0644 |
|
VoiceSelectionParams.php | File | 8.36 KB | 0644 |
|