Copy
Ask AI
"""
Audio To Text
=============================
Audio To Text.
"""
import requests
from agno.agent import Agent
from agno.media import Audio
from agno.models.google import Gemini
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
model=Gemini(id="gemini-3-flash-preview"),
markdown=True,
)
url = "https://agno-public.s3.us-east-1.amazonaws.com/demo_data/QA-01.mp3"
response = requests.get(url)
audio_content = response.content
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
# Give a transcript of this audio conversation. Use speaker A, speaker B to identify speakers.
agent.print_response(
"Give a transcript of this audio conversation. Use speaker A, speaker B to identify speakers.",
audio=[Audio(content=audio_content)],
stream=True,
)
Run the Example
Copy
Ask AI
# Clone and setup repo
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/02_agents/12_multimodal
# Create and activate virtual environment
./scripts/demo_setup.sh
source .venvs/demo/bin/activate
python audio_to_text.py