Gemini Audio logo

Gemini Audio

Community
einverne
gemini-audio

Guide for implementing Google Gemini API audio capabilities - analyze audio with transcription, summarization, and understanding (up to 9.5 hours), plus generate speech with controllable TTS. Use when processing audio files, creating transcripts, analyzing speech/music/sounds, or generating natural speech from text.

Overview

Publishereinverne
Repositorydotfiles
Skill namegemini-audio
Stars
121
Forks
24
Bundled files
9
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by einverne on GitHub. Read the source before you install it.

Installation

Install the Gemini Audio AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/einverne/dotfiles.git /tmp/dotfiles
mkdir -p .claude/skills
cp -r /tmp/dotfiles/claude/skills/gemini-audio .claude/skills/gemini-audio
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Gemini Audio in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Gemini Audio on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Gemini Audio is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Gemini Audio API Skill

Process audio with transcription, analysis, and understanding, plus generate natural speech using Google's Gemini API. Supports up to 9.5 hours of audio per request with multiple formats.

When to Use This Skill

Use this skill when you need to:

  • Transcribe audio files to text with timestamps
  • Summarize audio content and extract key points
  • Analyze speech, music, or environmental sounds
  • Generate speech from text with controllable voice and style
  • Process podcasts, interviews, meetings, or any audio content
  • Understand non-speech audio (birdsong, sirens, music)

Prerequisites

API Key Setup

The skill automatically detects your GEMINI_API_KEY in this order:

  1. Process environment: export GEMINI_API_KEY="your-key"
  2. Skill directory: .claude/skills/gemini-audio/.env
  3. Project directory: ./.env (project root)

Get your API key: Visit Google AI Studio

Create .env file with:

bash
GEMINI_API_KEY=your_api_key_here

Python Setup

Install required package:

bash
pip install google-genai

Quick Start

Audio Analysis (Transcription, Summarization)

python
from google import genai
import os

# API key auto-detected from environment
client = genai.Client(api_key=os.getenv('GEMINI_API_KEY'))

# Upload audio file
myfile = client.files.upload(file='podcast.mp3')

# Transcribe
response = client.models.generate_content(
    model='gemini-2.5-flash',
    contents=['Generate a transcript of the speech.', myfile]
)
print(response.text)

# Summarize
response = client.models.generate_content(
    model='gemini-2.5-flash',
    contents=['Summarize the key points in 5 bullets.', myfile]
)
print(response.text)

Using Helper Scripts

bash
# Transcribe audio
python .claude/skills/gemini-audio/scripts/transcribe.py audio.mp3

# Summarize audio
python .claude/skills/gemini-audio/scripts/analyze.py audio.mp3 \
  "Summarize key points"

# Analyze specific segment (timestamps in MM:SS format)
python .claude/skills/gemini-audio/scripts/analyze.py audio.mp3 \
  "What is discussed from 02:30 to 05:15?"

# Generate speech
python .claude/skills/gemini-audio/scripts/generate-speech.py \
  "Welcome to our podcast" \
  --output welcome.wav

Audio Understanding Capabilities

Supported Formats

FormatMIME TypeBest Use
WAVaudio/wavUncompressed, highest quality
MP3audio/mp3Compressed, widely compatible
AACaudio/aacCompressed, good quality
FLACaudio/flacLossless compression
OGG Vorbisaudio/oggOpen format
AIFFaudio/aiffApple format

Audio Specifications

  • Maximum length: 9.5 hours per request
  • Multiple files: Unlimited count, combined max 9.5 hours
  • Token rate: 32 tokens/second (1 minute = 1,920 tokens)
  • Processing: Auto-downsampled to 16 Kbps mono
  • File size limits:
    • Inline: 20 MB max total request
    • File API: 2 GB per file, 20 GB project quota
    • Retention: 48 hours auto-delete

Analysis Features

  • Transcription: Full text with punctuation
  • Timestamps: Reference segments (MM:SS format)
  • Multi-speaker: Identify different speakers
  • Non-speech: Analyze music, sounds, ambient audio
  • Languages: Support for multiple languages

Speech Generation (TTS)

Available TTS Models

ModelQualitySpeedCost/1M tokens
gemini-2.5-flash-native-audio-preview-09-2025HighFast$10
gemini-2.5-pro TTS modePremiumSlower$20

Controllable Voice Options

  • Style: Professional, casual, narrative, conversational
  • Pace: Slow, normal, fast
  • Tone: Friendly, serious, enthusiastic
  • Accent: Natural language control

TTS Example

python
response = client.models.generate_content(
    model='gemini-2.5-flash-native-audio-preview-09-2025',
    contents='Generate audio: Welcome to today\'s episode, in a warm, friendly tone.'
)

# Save audio output
with open('output.wav', 'wb') as f:
    f.write(response.audio_data)

Input Methods

Method 1: File Upload (Recommended for >20MB)

python
# Upload and reuse
myfile = client.files.upload(file='large-audio.mp3')

# Use file multiple times
response1 = client.models.generate_content(
    model='gemini-2.5-flash',
    contents=['Transcribe this', myfile]
)

response2 = client.models.generate_content(
    model='gemini-2.5-flash',
    contents=['Summarize this', myfile]
)

Method 2: Inline Data (<20MB)

python
from google.genai import types

with open('small-audio.mp3', 'rb') as f:
    audio_bytes = f.read()

response = client.models.generate_content(
    model='gemini-2.5-flash',
    contents=[
        'Describe this audio',
        types.Part.from_bytes(data=audio_bytes, mime_type='audio/mp3')
    ]
)

Common Use Cases

Transcription

bash
python scripts/transcribe.py meeting.mp3 --include-timestamps

Summary with Key Points

bash
python scripts/analyze.py interview.wav "Extract main topics and key quotes"

Speaker Identification

bash
python scripts/analyze.py discussion.mp3 "Identify speakers and extract dialogue"

Segment Analysis

bash
python scripts/analyze.py podcast.mp3 "Summarize content from 10:30 to 15:45"

Non-Speech Analysis

bash
python scripts/analyze.py ambient.wav "Identify all sounds: voices, music, ambient"

Best Practices

File Management

  • Use File API for files >20MB or repeated usage
  • Files auto-delete after 48 hours
  • Manage quota (20 GB project limit)

Prompt Engineering

  • Be specific: "Transcribe from 02:30 to 03:29"
  • Use timestamps for segment analysis (MM:SS format)
  • Combine tasks: "Transcribe and summarize"
  • Provide context: "This is a medical interview"

Cost Optimization

  • Use gemini-2.5-flash ($1/1M tokens) for most tasks
  • Upgrade to gemini-2.5-pro ($3/1M tokens) for complex analysis
  • Check token count: 1 min audio = 1,920 tokens

Error Handling

  • Validate file format and size before upload
  • Implement exponential backoff for rate limits
  • Handle 48-hour file expiration

Token Costs & Pricing

Audio Input (32 tokens/second):

  • 1 minute = 1,920 tokens
  • 1 hour = 115,200 tokens
  • 9.5 hours = 1,094,400 tokens

Model Pricing:

  • Gemini 2.5 Flash: $1.00/1M input, $0.10/1M output
  • Gemini 2.5 Pro: $3.00/1M input, $12.00/1M output
  • Gemini 1.5 Flash: $0.70/1M input, $0.175/1M output

TTS Pricing:

  • Flash TTS: $10/1M tokens
  • Pro TTS: $20/1M tokens

Reference Documentation

For detailed information, see:

  • references/api-reference.md - Complete API specifications
  • references/code-examples.md - Comprehensive code examples
  • references/tts-guide.md - Text-to-speech implementation guide
  • references/best-practices.md - Advanced optimization strategies

Scripts Overview

All scripts support 3-step API key detection:

  • transcribe.py: Generate transcripts with optional timestamps
  • analyze.py: General audio analysis with custom prompts
  • generate-speech.py: Text-to-speech generation
  • manage-files.py: Upload, list, and delete audio files

Run any script with --help for detailed usage.

Resources

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Gemini Audio AI skill do?

Guide for implementing Google Gemini API audio capabilities - analyze audio with transcription, summarization, and understanding (up to 9.5 hours), plus generate speech with controllable TTS. Use when processing audio files, creating transcripts, analyzing speech/music/sounds, or generating natural speech from text.

Why use Gemini Audio on TypingMind?

Because you install it once and use it with any model. Gemini Audio is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Gemini Audio in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/einverne/dotfiles/tree/master/claude/skills/gemini-audio. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Gemini Audio?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Gemini Audio?

As many as you like. As long as a model supports skills, you can use Gemini Audio with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Gemini Audio AI skill free?

Yes. It is published on GitHub by einverne under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇