{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "0fgOxpmGrOvn"
},
"source": [
"##### Copyright 2026 Google LLC."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "zxdx4xJxrTfP"
},
"outputs": [],
"source": [
"# @title Licensed under the Apache License, Version 2.0 (the \"License\");\n",
"# you may not use this file except in compliance with the License.\n",
"# You may obtain a copy of the License at\n",
"#\n",
"# https://www.apache.org/licenses/LICENSE-2.0\n",
"#\n",
"# Unless required by applicable law or agreed to in writing, software\n",
"# distributed under the License is distributed on an \"AS IS\" BASIS,\n",
"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
"# See the License for the specific language governing permissions and\n",
"# limitations under the License."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Qw6ttkOtrQ_D"
},
"source": [
"# Gemini API: Gemini Text-to-speech",
"\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "y7f4kFby0E6j"
},
"source": [
"The Gemini API can transform text input into single speaker or multi-speaker audio (podcast-like experience like in [NotebookLM](https://notebooklm.google.com/). This notebook provides an example of how to control the *Text-to-speech* (TTS) capability of the Gemini model and guide its style, accent, pace, and tone.\n",
"\n",
"Before diving in the code, you should try this capability on [AI Studio](https://aistudio.google.com/prompts/new_chat?model=gemini-2.5-flash-preview-tts).\n",
"\n",
"**Note that the TTS model can only do TTS, it does not have the reasoning capabilities of the Gemini models, so you can ask things like \"say this in that style\", but not \"tell me why the sky is blue\".** If that's what you want, you should use the [Live API](./Get_started_LiveAPI.ipynb) instead.\n",
"\n",
"The [documentation](https://ai.google.dev/gemini-api/docs/audio-generation) is also a good place to start discovering the TTS capability."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "fzgIhXhB4KSR"
},
"source": [
"\n",
"
| \n", " 🪧\n", " | \n", " \n", "\n",
" Audio-out is a preview feature. It is free to use for now with quota limitations, but is subject to change.\n", " | \n",
"