Skip to main content

Gemini TTS CLI

Project description

iGTTS(Gemini TTS)

iGTTS(Gemini TTS) 开源免费的文本转语音(TTS)的命令行工具。
iGTTS(Gemini TTS) 是通过调用 Gemini TTS 的接口,实现文本转语音(TTS)的命令行工具。

添加 API key

# 编辑 .zshrc:
vim ~/.zshrc

# 添加信息(导入环境变量):
export GEMINI_API_KEY=<YOUR_API_KEY_HERE>

# 保存后应用更改:
source ~/.zshrc

安装 iGTTS

pip install igtts

运行 iGTTS

igtts -h
usage: igtts [-h] [-i INPUT_FILE] [-l] [-v VOICE] [-o OUTPUT_FILE] [text]

Gemini TTS 文本转语音(TTS)命令行工具。

positional arguments:
  text                  指定语音文本的内容。如果未提供,请使用 --input-file。

options:
  -h, --help            show this help message and exit
  -i, --input-file INPUT_FILE
                        指定语音文本的文件。
  -l, --list-voices     列出语音的语音名称。
  -v, --voice VOICE     指定语音的语音名称(默认:Zephyr)。
  -o, --output-file OUTPUT_FILE
                        指定音频保存的文件(默认:output.wav)。

实例

# 指定语音文本的内容
igtts "Hello, my name is iChochy."

# 指定语音文本的文件 -i "input.txt"
igtts -i "input.txt"

# 指定语音文本的文件 -i "input.txt"
# 指定语音保存的文件 -o "output.wav"
igtts -i "input.txt" -o "output.mp3"

# 指定语音文本的文件 -i "input.txt"
# 指定语音的语音名称 -v "Zephyr"
# 指定音频保存的文件 -o "output.wav"
igtts -i "input.txt" -v "Zephyr" -o "output.mp3"

# 列出语音的语音名称 -l
igtts -l

模型

gemini-2.5-flash-preview-tts

获取 API key

API key:https://aistudio.google.com/apikey

额度参数:

每分钟请求数 (RPM)
每分钟 token 数(输入)(TPM)
每日请求数 (RPD)

免费额度:

RPM:3
TPM:10000
RPD:15

额度详情:https://ai.google.dev/gemini-api/docs/rate-limits?hl=zh-cn

接口详情:https://ai.google.dev/gemini-api/docs/speech-generation?hl=zh-cn

软件信息

网站

https://tts.ichochy.com

GitHub

https://github.com/ichochy/igtts

PYPI

https://pypi.org/project/igtts

音频预览

Default:audio.wav
GitHub:audio.wav

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

igtts-0.1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

igtts-0.1.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file igtts-0.1.2.tar.gz.

File metadata

  • Download URL: igtts-0.1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for igtts-0.1.2.tar.gz
Algorithm Hash digest
SHA256 453f38905c86841601b5dfb044c26e05a9d3e95ff095eceece5a8aa2dcaee80d
MD5 f227569d4a47b33ca60a2e97a3b5a090
BLAKE2b-256 c840b0175690af721a5e325661fc57de242a0dd6aaa921fde846b55d80cfde25

See more details on using hashes here.

File details

Details for the file igtts-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: igtts-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for igtts-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ec1a008e71e85a987818a3bb67b450a44b67b4203e47b7738f102a1556bd3018
MD5 bade36c8b4bda804ea254a0f165f8410
BLAKE2b-256 b4eae537e13a41892dce3ca4dbe84a5f0d038ec9d6acdd9b447cb2a56702118b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page