Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
OurBuilding Ambient Agents with LangGraph course is now available on LangChain Academy!
Open In ColabOpen on GitHub

Google Cloud Text-to-Speech

Google Cloud Text-to-Speech enables developers to synthesize natural-sounding speech with 100+ voices, available in multiple languages and variants. It applies DeepMind’s groundbreaking research in WaveNet and Google’s powerful neural networks to deliver the highest fidelity possible.

It supports multiple languages, including English, German, Polish, Spanish, Italian, French, Portuguese, and Hindi.

This notebook shows how to interact with theGoogle Cloud Text-to-Speech API to achieve speech synthesis capabilities.

First, you need to set up an Google Cloud project. You can follow the instructionshere.

!pip install--upgrade langchain-google-community[texttospeech]

Instantiation

from langchain_google_communityimport TextToSpeechTool
API Reference:TextToSpeechTool

Deprecated GoogleCloudTextToSpeechTool

from langchain_community.toolsimport GoogleCloudTextToSpeechTool
text_to_speak="Hello world!"

tts= GoogleCloudTextToSpeechTool()
tts.name

We can generate audio, save it to the temporary file and then play it.

speech_file= tts.run(text_to_speak)

Related


[8]ページ先頭

©2009-2025 Movatter.jp