> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Running the Audio Analytics container

> Deploy and run the Audio Analytics container for on-device ASR, text translation, and TTS.

Qualcomm's Audio Analytics container exposes speech recognition (ASR), text translation (T2T), and text-to-speech (TTS) through a REST and WebSocket API. All models run fully on-device on the Qualcomm NPU.

## Key features

* **Three services in one container**: ASR, text-to-text translation, and TTS exposed through a single API
* **NPU-accelerated**: Whisper, OpusMT, MeloTTS, and PiperTTS models all run on the Qualcomm NPU, freeing the CPU for other tasks
* **Multilingual**: English, Spanish, and Chinese supported across all three services; German and Italian available via PiperTTS
* **Streaming support**: Real-time transcription via WebSocket alongside batch file-based transcription
* **OpenAPI / Swagger UI**: Interactive API docs available at `http://<device-ip>:8085/docs`

## Supported models

| Service     | Model                                                  | Languages                 | Sample Rate |
| ----------- | ------------------------------------------------------ | ------------------------- | ----------- |
| ASR         | `whisper-small-quantized`                              | English, Spanish, Chinese | 16000 Hz    |
| Translation | `opus-en-es`, `opus-es-en`, `opus-en-zh`, `opus-zh-en` | English, Spanish, Chinese | n/a         |
| TTS         | `melo-tts-en`, `melo-tts-es`, `melo-tts-zh`            | English, Spanish, Chinese | 44100 Hz    |
| TTS         | `piper-tts-en`, `piper-tts-de`, `piper-tts-it`         | English, German, Italian  | 22050 Hz    |

These are the currently supported models. Query `/transcriptions/models`, `/translations/models`, and `/tts/models` to confirm which models are loaded at runtime.

## Setup

The steps below assume you have already set up your device ([IQ-9075 EVK](/devices/iq9075-evk/set-up-the-device) or [IQ-8275 EVK](/devices/iq8275-evk/set-up-the-device)). Once your device is set up, follow these steps to deploy and run the Audio Analytics container.

<Steps>
  <Step title="Install required packages">
    SSH into your device and install the required packages:

    ```bash theme={null}
    sudo apt update
    sudo apt install curl unzip docker-compose
    ```
  </Step>

  <Step title="Set up Docker">
    ```bash theme={null}
    # Configure Docker group
    sudo groupadd docker
    sudo usermod -aG docker $USER
    newgrp docker
    ```
  </Step>

  <Step title="Download the models">
    Create the model directory structure and download all models from QAI Hub.

    <AccordionGroup>
      <Accordion title="IQ-9075 EVK">
        ```bash theme={null}
        mkdir -p ~/models/audio/asr ~/models/audio/tts ~/models/audio/translation
        cd ~/models

        # ASR — Whisper Small
        curl -L -o whisper_small_quantized.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/whisper_small_quantized/releases/v0.57.0/whisper_small_quantized-voice_ai-w8a16-qualcomm_qcs9075.zip
        unzip -q whisper_small_quantized.zip -d audio/asr && rm whisper_small_quantized.zip

        # TTS — MeloTTS (English, Spanish, Chinese)
        curl -L -o melotts_en.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/melotts_en/releases/v0.57.0/melotts_en-voice_ai-mixed_with_float-qualcomm_qcs9075.zip
        unzip -q melotts_en.zip -d audio/tts && rm melotts_en.zip

        curl -L -o melotts_es.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/melotts_es/releases/v0.57.0/melotts_es-voice_ai-mixed_with_float-qualcomm_qcs9075.zip
        unzip -q melotts_es.zip -d audio/tts && rm melotts_es.zip

        curl -L -o melotts_zh.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/melotts_zh/releases/v0.57.0/melotts_zh-voice_ai-mixed_with_float-qualcomm_qcs9075.zip
        unzip -q melotts_zh.zip -d audio/tts && rm melotts_zh.zip

        # TTS — PiperTTS (English, German, Italian)
        curl -L -o pipertts_en.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/pipertts_en/releases/v0.57.0/pipertts_en-voice_ai-float-qualcomm_qcs9075.zip
        unzip -q pipertts_en.zip -d audio/tts && rm pipertts_en.zip

        curl -L -o pipertts_de.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/pipertts_de/releases/v0.57.0/pipertts_de-voice_ai-float-qualcomm_qcs9075.zip
        unzip -q pipertts_de.zip -d audio/tts && rm pipertts_de.zip

        curl -L -o pipertts_it.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/pipertts_it/releases/v0.57.0/pipertts_it-voice_ai-float-qualcomm_qcs9075.zip
        unzip -q pipertts_it.zip -d audio/tts && rm pipertts_it.zip

        # Translation — Opus (English ↔ Spanish, English ↔ Chinese)
        curl -L -o opus_mt_en_es.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/opus_mt_en_es/releases/v0.57.0/opus_mt_en_es-voice_ai-float-qualcomm_qcs9075.zip
        unzip -q opus_mt_en_es.zip -d audio/translation && rm opus_mt_en_es.zip

        curl -L -o opus_mt_es_en.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/opus_mt_es_en/releases/v0.57.0/opus_mt_es_en-voice_ai-float-qualcomm_qcs9075.zip
        unzip -q opus_mt_es_en.zip -d audio/translation && rm opus_mt_es_en.zip

        curl -L -o opus_mt_en_zh.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/opus_mt_en_zh/releases/v0.57.0/opus_mt_en_zh-voice_ai-float-qualcomm_qcs9075.zip
        unzip -q opus_mt_en_zh.zip -d audio/translation && rm opus_mt_en_zh.zip

        curl -L -o opus_mt_zh_en.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/opus_mt_zh_en/releases/v0.57.0/opus_mt_zh_en-voice_ai-float-qualcomm_qcs9075.zip
        unzip -q opus_mt_zh_en.zip -d audio/translation && rm opus_mt_zh_en.zip
        ```
      </Accordion>

      <Accordion title="IQ-8275 EVK">
        ```bash theme={null}
        mkdir -p ~/models/audio/asr ~/models/audio/tts ~/models/audio/translation
        cd ~/models

        # ASR — Whisper Small
        curl -L -o whisper_small_quantized.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/whisper_small_quantized/releases/v0.57.0/whisper_small_quantized-voice_ai-w8a16-qualcomm_qcs8275.zip
        unzip -q whisper_small_quantized.zip -d audio/asr && rm whisper_small_quantized.zip

        # TTS — MeloTTS (English, Spanish, Chinese)
        curl -L -o melotts_en.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/melotts_en/releases/v0.57.0/melotts_en-voice_ai-mixed_with_float-qualcomm_qcs8275.zip
        unzip -q melotts_en.zip -d audio/tts && rm melotts_en.zip

        curl -L -o melotts_es.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/melotts_es/releases/v0.57.0/melotts_es-voice_ai-mixed_with_float-qualcomm_qcs8275.zip
        unzip -q melotts_es.zip -d audio/tts && rm melotts_es.zip

        curl -L -o melotts_zh.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/melotts_zh/releases/v0.57.0/melotts_zh-voice_ai-mixed_with_float-qualcomm_qcs8275.zip
        unzip -q melotts_zh.zip -d audio/tts && rm melotts_zh.zip

        # TTS — PiperTTS (English, German, Italian)
        curl -L -o pipertts_en.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/pipertts_en/releases/v0.57.0/pipertts_en-voice_ai-float-qualcomm_qcs8275.zip
        unzip -q pipertts_en.zip -d audio/tts && rm pipertts_en.zip

        curl -L -o pipertts_de.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/pipertts_de/releases/v0.57.0/pipertts_de-voice_ai-float-qualcomm_qcs8275.zip
        unzip -q pipertts_de.zip -d audio/tts && rm pipertts_de.zip

        curl -L -o pipertts_it.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/pipertts_it/releases/v0.57.0/pipertts_it-voice_ai-float-qualcomm_qcs8275.zip
        unzip -q pipertts_it.zip -d audio/tts && rm pipertts_it.zip

        # Translation — Opus (English ↔ Spanish, English ↔ Chinese)
        curl -L -o opus_mt_en_es.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/opus_mt_en_es/releases/v0.57.0/opus_mt_en_es-voice_ai-float-qualcomm_qcs8275.zip
        unzip -q opus_mt_en_es.zip -d audio/translation && rm opus_mt_en_es.zip

        curl -L -o opus_mt_es_en.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/opus_mt_es_en/releases/v0.57.0/opus_mt_es_en-voice_ai-float-qualcomm_qcs8275.zip
        unzip -q opus_mt_es_en.zip -d audio/translation && rm opus_mt_es_en.zip

        curl -L -o opus_mt_en_zh.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/opus_mt_en_zh/releases/v0.57.0/opus_mt_en_zh-voice_ai-float-qualcomm_qcs8275.zip
        unzip -q opus_mt_en_zh.zip -d audio/translation && rm opus_mt_en_zh.zip

        curl -L -o opus_mt_zh_en.zip \
          https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/opus_mt_zh_en/releases/v0.57.0/opus_mt_zh_en-voice_ai-float-qualcomm_qcs8275.zip
        unzip -q opus_mt_zh_en.zip -d audio/translation && rm opus_mt_zh_en.zip
        ```
      </Accordion>
    </AccordionGroup>

    Your models directory should now look like this:

    ```
    ~/models/audio/
    ├── asr/          ← whisper_small_quantized
    ├── tts/          ← melotts_en, melotts_es, melotts_zh, pipertts_en, pipertts_de, pipertts_it
    └── translation/  ← opus_mt_en_es, opus_mt_es_en, opus_mt_en_zh, opus_mt_zh_en
    ```
  </Step>

  <Step title="Get the Docker Compose file">
    Download the Docker Compose file for your device from the [CodeLinaro audio-analytics deploy directory](https://git.codelinaro.org/clo/iot-solutions-microservices/audio-analytics/-/tree/main/deploy).

    <AccordionGroup>
      <Accordion title="IQ-9075 EVK">
        **Option A — download directly on the device:**

        ```bash theme={null}
        curl -L -o docker-compose-qcs9100.yml \
          https://git.codelinaro.org/clo/iot-solutions-microservices/audio-analytics/-/raw/main/deploy/docker-compose-qcs9100.yml
        ```

        **Option B — download locally and copy to the device:**

        ```bash theme={null}
        scp docker-compose-qcs9100.yml ubuntu@<device-ip>:~/
        ```
      </Accordion>

      <Accordion title="IQ-8275 EVK">
        **Option A — download directly on the device:**

        ```bash theme={null}
        curl -L -o docker-compose-qcs8300.yml \
          https://git.codelinaro.org/clo/iot-solutions-microservices/audio-analytics/-/raw/main/deploy/docker-compose-qcs8300.yml
        ```

        **Option B — download locally and copy to the device:**

        ```bash theme={null}
        scp docker-compose-qcs8300.yml ubuntu@<device-ip>:~/
        ```
      </Accordion>
    </AccordionGroup>

    <Note>The remaining steps use `docker-compose-qcs9100.yml`. If you are on the IQ-8275 EVK, substitute `docker-compose-qcs8300.yml` in each command.</Note>
  </Step>

  <Step title="Configure the container">
    Open the Docker Compose file and adjust the following environment variables as needed:

    * **`MODELS_DIR`**: Base path for all models inside the container (default: `/mnt/work/models`)
    * **`SESSION_TIMEOUT_S`**: Seconds of inactivity before an ASR streaming session is automatically closed (default: `30`)
    * **`LOG_LEVEL`**: `10`=DEBUG, `20`=INFO, `30`=WARNING, `40`=ERROR (default: `20`)

    Under `volumes:`

    * **Model path**: By default maps `~/models/audio` on the host to `/mnt/work/models` in the container. If you placed your models elsewhere, update the left side of the volume mount:

    ```yaml theme={null}
    volumes:
      - ~/models/audio:/mnt/work/models:ro
    ```

    <Warning>Make sure the volume mount points to your models directory and that the directory is readable by the container. If models fail to load, check directory permissions with `ls -la ~/models/audio`.</Warning>
  </Step>

  <Step title="Start the container">
    The Docker Compose file pulls the container image automatically if it isn't already present.

    ```bash theme={null}
    docker compose -f docker-compose-qcs9100.yml up -d
    ```

    Verify the container is running:

    ```bash theme={null}
    docker ps | grep audio-analytics
    ```
  </Step>

  <Step title="Verify the service is running">
    Once ready, check the health endpoint:

    ```bash theme={null}
    curl http://localhost:8085/audio-analytics/v1/api/health
    ```

    Expected response:

    ```json theme={null}
    { "status": "ok", "uptime": 12345, "active_sessions": 0, "version": "1.0.0" }
    ```

    You can also confirm which models are loaded:

    ```bash theme={null}
    curl http://localhost:8085/audio-analytics/v1/api/transcriptions/models
    curl http://localhost:8085/audio-analytics/v1/api/translations/models
    curl http://localhost:8085/audio-analytics/v1/api/tts/models
    ```
  </Step>

  <Step title="Test each service">
    Run a quick smoke test for each of the three services.

    **ASR — transcribe audio:**

    ```bash theme={null}
    curl -X POST http://localhost:8085/audio-analytics/v1/api/transcriptions/create \
      -F 'file=@audio.wav' \
      -F 'model=whisper-small-quantized' \
      -F 'language=en' \
      -F 'stream=false'
    ```

    Expected response:

    ```json theme={null}
    { "text": "Your transcribed text here.", "language": "en", "type": "transcript.text.done" }
    ```

    **Translation — translate text:**

    ```bash theme={null}
    curl -X POST http://localhost:8085/audio-analytics/v1/api/translations/translate \
      -H 'Content-Type: application/json' \
      -d '{"text": ["Hello world"], "model": "opus-en-es", "source_language": "en", "target_language": "es"}'
    ```

    Expected response:

    ```json theme={null}
    { "translations": [{ "translated_text": "Hola mundo", "source_language": "en", "target_language": "es" }] }
    ```

    **TTS — synthesize speech:**

    ```bash theme={null}
    curl -X POST http://localhost:8085/audio-analytics/v1/api/tts/synthesize \
    -H 'Content-Type: application/json' \
    -d '{"text": "Hello, how are you today?", "model": "melo-tts-en", "language": "en", "sample_rate": 44100}' \
    --output speech.pcm
    ```
  </Step>

  <Step title="Stop the container">
    When you are finished:

    ```bash theme={null}
    docker compose -f docker-compose-qcs9100.yml down
    ```
  </Step>
</Steps>

## Viewing logs

All container output is available via `docker logs`. There are no separate log files.

```bash theme={null}
# Stream all logs
docker logs audio-analytics -f -t
```

To adjust log verbosity, set `LOG_LEVEL` in your Docker Compose file and restart the container:

| Value | Level          |
| ----- | -------------- |
| `10`  | DEBUG          |
| `20`  | INFO (default) |
| `30`  | WARNING        |
| `40`  | ERROR          |

## Next steps

<CardGroup cols={3}>
  <Card title="Speech recognition" icon="microphone" href="/ai-workflows/asr-container">
    File-based and real-time streaming transcription
  </Card>

  <Card title="Text-to-speech" icon="volume-high" href="/ai-workflows/tts-container">
    Synthesize natural speech in multiple languages
  </Card>

  <Card title="Language translation" icon="language" href="/ai-workflows/language-translation">
    Translate text between languages on-device
  </Card>
</CardGroup>
