Skip to content

Latest commit

 

History

History
113 lines (89 loc) · 3.46 KB

File metadata and controls

113 lines (89 loc) · 3.46 KB
title Real-Time Audio Streaming
icon wave-square
description Stream audio bytes from your Omi device to any backend service in real time.

Overview

Omi streams raw audio bytes from your device to any webhook endpoint you configure. Use this to build custom audio processing, live transcription, or recording workflows.

Stream to your own server, cloud function, or local dev environment Choose how often you receive audio chunks (e.g. every 5, 10, or 30 seconds) Receive raw PCM bytes — add a WAV header to save as audio files

Setup

Build an endpoint that accepts POST requests with raw audio bytes.
Omi sends requests in this format:

```
POST /your-endpoint?sample_rate=16000&uid=user123
Content-Type: application/octet-stream

[raw audio bytes]
```

| Parameter | Description |
|-----------|-------------|
| `sample_rate` | Audio samples per second (see table below) |
| `uid` | The user's unique ID in Omi |
| Body | Raw PCM audio bytes (`application/octet-stream`) |

<Accordion title="Sample Rates by Device" icon="microchip">
  | Device | Sample Rate |
  |--------|-------------|
  | Omi (consumer) | 16,000 Hz |
  | DevKit 2 | 16,000 Hz |
  | DevKit 1 (v1.0.4+) | 16,000 Hz |
  | DevKit 1 (v1.0.2) | 8,000 Hz |
</Accordion>
1. Open the Omi app 2. Go to **Settings → Developer Mode** 3. Scroll to **Realtime audio bytes** 4. Enter your webhook URL 5. Set the interval (e.g. `10` for every 10 seconds) Audio bytes should start arriving at your endpoint. The data is raw PCM — to save as a playable audio file, prepend a WAV header to the accumulated bytes.

Example: Save to Google Cloud Storage

A complete example that saves audio chunks as WAV files in GCS.

Follow the [Cloud Audio Storage](/doc/developer/savingaudio) guide to create a bucket and get credentials. 1. Fork [github.com/mdmohsin7/omi-audio-streaming](https://github.com/mdmohsin7/omi-audio-streaming) 2. Clone and deploy to any cloud provider (GCP, AWS, DigitalOcean) or run locally with [ngrok](https://ngrok.com/) 3. Set these environment variables:
| Variable | Value |
|----------|-------|
| `GOOGLE_APPLICATION_CREDENTIALS_JSON` | Base64-encoded GCP key |
| `GCS_BUCKET_NAME` | Your bucket name |

The repo includes a Dockerfile for easy deployment.
Set the endpoint in the Omi app under **Realtime audio bytes** to:
```
https://your-deployment.com/audio
```

Audio files will appear in your GCS bucket at the configured interval.

Related

Set up GCS bucket and credentials Create Omi apps with audio capabilities