Client libraries

While you can use Speech-to-Text by making direct requests, we provide client libraries for several popular languages. Speech-to-Text client libraries are built on Google Cloud Client Libraries. This common infrastructure provides functionality for API-specific library implementations, but it also provides types and methods that you may use directly when using any Cloud API.

Available client libraries

Speech-to-Text provides client libraries and guides for the following languages:

Python

To learn how to install and use the client library for Speech-to-Text, see Speech-to-Text client libraries. For more information, see the Speech-to-Text Python API reference documentation.

To authenticate to Speech-to-Text, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

This page provides reference documentation and related resources for the Speech-to-Text Python client library.

Resource Description
Library reference Speech-to-Text Python library reference
Language guide General guide for using Python with GCP
GitHub repository Source code and additional documentation for this library
Stack Overflow Questions tagged with Speech-to-Text and Python

Installation

To install the client library:

pip install --upgrade google-cloud-speech

Java

To learn how to install and use the client library for Speech-to-Text, see Speech-to-Text client libraries. For more information, see the Speech-to-Text Java API reference documentation.

To authenticate to Speech-to-Text, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

This page provides reference documentation and related resources for the Speech-to-Text Java client library.

Resource Description
Library reference Speech-to-Text Java library reference
Language guide General guide for using Java with GCP
GitHub repository Source code and additional documentation for this library
Stack Overflow Questions tagged with Speech-to-Text and Java

Installation

To install the client library:

If you are using Maven, add the following to your pom.xml file. For more information about BOMs, see The Google Cloud Platform Libraries BOM.

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>libraries-bom</artifactId>
      <version>26.51.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

<dependencies>
  <dependency>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-speech</artifactId>
  </dependency>
</dependencies>

If you are using Gradle, add the following to your dependencies:

implementation 'com.google.cloud:google-cloud-speech:4.49.0'

If you are using sbt, add the following to your dependencies:

libraryDependencies += "com.google.cloud" % "google-cloud-speech" % "4.49.0"

If you're using Visual Studio Code, IntelliJ, or Eclipse, you can add client libraries to your project using the following IDE plugins:

The plugins provide additional functionality, such as key management for service accounts. Refer to each plugin's documentation for details.

Node.js

To learn how to install and use the client library for Speech-to-Text, see Speech-to-Text client libraries. For more information, see the Speech-to-Text Node.js API reference documentation.

To authenticate to Speech-to-Text, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

This page provides reference documentation and related resources for the Speech-to-Text Node.js client library.

Resource Description
Library reference Speech-to-Text Node.js library reference
Language guide General guide for using Node.js with GCP
GitHub repository Source code and additional documentation for this library
Stack Overflow Questions tagged with Speech-to-Text and Node.js

Installation

To install the client library:

npm install --save @google-cloud/speech

C#

To learn how to install and use the client library for Speech-to-Text, see Speech-to-Text client libraries.

To authenticate to Speech-to-Text, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

This page provides reference documentation and related resources for the Speech-to-Text C# client library.

Resource Description
Library reference Speech-to-Text C# library reference
Language guide General guide for using C# with GCP
GitHub repository Source code and additional documentation for this library
Stack Overflow Questions tagged with Speech-to-Text and C#

Installation

To install the client library:

Install-Package Google.Cloud.Speech.V1 -Pre

C++

To learn how to install and use the client library for Speech-to-Text, see Speech-to-Text client libraries.

To authenticate to Speech-to-Text, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

This page provides reference documentation and related resources for the Speech-to-Text C++ client library.

Resource Description
Library reference Speech-to-Text C++ library reference
Language guide General guide for using C++ with GCP
GitHub repository Source code and additional documentation for this library
Stack Overflow Questions tagged with Speech-to-Text and C++

Installation

To install the client library:

See Setting Up a C++ Development Environment.

Go

To learn how to install and use the client library for Speech-to-Text, see Speech-to-Text client libraries. For more information, see the Speech-to-Text Go API reference documentation.

To authenticate to Speech-to-Text, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

This page provides reference documentation and related resources for the Speech-to-Text Go client library.

Resource Description
Library reference Speech-to-Text Go library reference
Language guide General guide for using Go with GCP
GitHub repository Source code and additional documentation for this library
Stack Overflow Questions tagged with Speech-to-Text and Go

Installation

To install the client library:

go get cloud.google.com/go/speech/apiv1

PHP

To learn how to install and use the client library for Speech-to-Text, see Speech-to-Text client libraries.

To authenticate to Speech-to-Text, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

This page provides reference documentation and related resources for the Speech-to-Text PHP client library.

Resource Description
Library reference Speech-to-Text PHP library reference
Language guide General guide for using PHP with GCP
GitHub repository Source code and additional documentation for this library
Stack Overflow Questions tagged with Speech-to-Text and PHP

Installation

To install the client library:

composer require google/cloud-speech

Ruby

To learn how to install and use the client library for Speech-to-Text, see Speech-to-Text client libraries.

To authenticate to Speech-to-Text, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

The Ruby client libraries for Speech-to-Text are currently released as Beta.

This page provides reference documentation and related resources for the Speech-to-Text Ruby client library.

Resource Description
Library reference Speech-to-Text Ruby library reference
Language guide General guide for using Ruby with GCP
GitHub repository Source code and additional documentation for this library
Stack Overflow Questions tagged with Speech-to-Text and Ruby

Installation

To install the client library:

gem install google-cloud-speech

Authentication and access control

The Speech-to-Text quickstart guides provide basic information on authentication and access control. For more detailed information, see the following: