google/cloud-text-to-speech

Cloud Text-to-Speech Client for PHP

Package info

github.com/googleapis/google-cloud-php-text-to-speech

pkg:composer/google/cloud-text-to-speech

Statistics

Installs: 1 111 772

Dependents: 7

Suggesters: 1

Stars: 66

v2.8.0 2026-04-09 21:01 UTC

Requires

Requires (Dev)

Suggests

  • ext-grpc: Enables use of gRPC, a universal high-performance RPC framework created by Google.
  • ext-protobuf: Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.

Provides

None

Conflicts

None

Replaces

None

Apache-2.0 6d7e5a1366991cf104b4cf30f5fe74efb90bd71d


README

Idiomatic PHP client for Cloud Text-to-Speech.

👁 Latest Stable Version
👁 Packagist

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

Installation

To begin, install the preferred dependency manager for PHP, Composer.

Now install this component:

$ 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.

Sample

use Google\ApiCore\ApiException;
use Google\Cloud\TextToSpeech\V1\Client\TextToSpeechClient;
use Google\Cloud\TextToSpeech\V1\ListVoicesRequest;
use Google\Cloud\TextToSpeech\V1\ListVoicesResponse;

// Create a client.
$textToSpeechClient = new TextToSpeechClient();

// Prepare the request message.
$request = new ListVoicesRequest();

// Call the API and handle any network failures.
try {
 /** @var ListVoicesResponse $response */
 $response = $textToSpeechClient->listVoices($request);
 printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
 printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}

Debugging

Please see our Debugging guide for more information about the debugging tools.

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.

Next Steps

  1. Understand the official documentation.