2017 © Pedro Peláez
 

library cloud-text-to-speech

Cloud Text-to-Speech Client for PHP

image

google/cloud-text-to-speech

Cloud Text-to-Speech Client for PHP

  • Thursday, July 19, 2018
  • by bshaffer
  • Repository
  • 8 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Cloud Text-to-Speech for PHP

Idiomatic PHP client for Cloud Text-to-Speech., (*1)

Latest Stable Version Packagist, (*2)

NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project., (*3)

Installation

To begin, install the preferred dependency manager for PHP, Composer., (*4)

Now install this component:, (*5)

$ composer require google/cloud-text-to-speech

Authentication

Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests., (*6)

Sample

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\Client\TextToSpeechClient;
use Google\Cloud\TextToSpeech\V1\VoiceSelectionParams;
use Google\Cloud\TextToSpeech\V1\SynthesizeSpeechRequest;

$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);
$request = (new SynthesizeSpeechRequest())
    ->setInput($input)
    ->setVoice($voice)
    ->setAudioConfig($audioConfig);

$resp = $textToSpeechClient->synthesizeSpeech($request);
file_put_contents('test.mp3', $resp->getAudioContent());

Debugging

Please see our Debugging guide for more information about the debugging tools., (*7)

Version

This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority., (*8)

Next Steps

  1. Understand the official documentation.

The Versions

19/07 2018

dev-master

9999999-dev

Cloud Text-to-Speech Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

19/07 2018

v0.1.1

0.1.1.0

Cloud Text-to-Speech Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

11/07 2018

v0.1.0

0.1.0.0

Cloud Text-to-Speech Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires