> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Audio Sentiment Analysis

> Analyze sentiment and identify speakers in an audio conversation with Gemini, and persist the session history in SQLite.

Run sentiment analysis on an audio conversation with a multimodal agent.

```python audio_sentiment_analysis.py theme={null}
import requests
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.media import Audio
from agno.models.google import Gemini

agent = Agent(
    model=Gemini(id="gemini-3.5-flash"),
    add_history_to_context=True,
    markdown=True,
    db=SqliteDb(
        session_table="audio_sentiment_analysis_sessions",
        db_file="tmp/audio_sentiment_analysis.db",
    ),
)

url = "https://agno-public.s3.amazonaws.com/demo_data/sample_conversation.wav"

response = requests.get(url)
audio_content = response.content

# Give a sentiment analysis of this audio conversation. Use speaker A, speaker B to identify speakers.
agent.print_response(
    "Give a sentiment analysis of this audio conversation. Use speaker A, speaker B to identify speakers.",
    audio=[Audio(content=audio_content)],
    stream=True,
)

agent.print_response(
    "What else can you tell me about this audio conversation?",
    stream=True,
)
```

## Usage

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U google-genai sqlalchemy requests agno
```

**2. Export your Google API key**

```bash Mac/Linux theme={null}
  export GOOGLE_API_KEY="your_google_api_key_here"
```

```bash Windows theme={null}
  $Env:GOOGLE_API_KEY="your_google_api_key_here"
```

**3. Run Agent**

```bash theme={null}
python audio_sentiment_analysis.py
```

## Key Features

* **Audio Processing**: Downloads and processes audio files from remote URLs
* **Sentiment Analysis**: Analyzes emotional tone and sentiment in conversations
* **Speaker Identification**: Distinguishes between different speakers in the conversation
* **Persistent Sessions**: Maintains conversation history using SQLite database
* **Streaming Response**: Real-time response generation for better user experience

## Use Cases

* Customer service call analysis
* Meeting sentiment tracking
* Interview evaluation
* Call center quality monitoring


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.