Skip to content

Conversation

arsenkylyshbek
Copy link
Collaborator

Feature #3149 - Voice responses in headphones

Added support for playing Omi's AI responses directly through headphones when you ask questions via the device button.

How it works:

  • Press and hold the Omi device button to ask a question
  • If you have headphones/AirPods connected, you'll hear the AI's response spoken directly in your ears
  • Works even when the phone screen is off and the app is in the background
  • Uses OpenAI's TTS API for natural-sounding voice

Implementation:

  • iOS only for now (requires background audio session management)
  • Added as an experimental feature in Settings > Developer Mode > Experimental
  • Disabled by default - users need to opt in
  • Pre-activates audio session when BLE device connects to enable background playback
  • Automatically detects headphone connection and routes audio appropriately

Technical details:

  • Native Swift AVAudioSession and AVAudioPlayer for background audio
  • Flutter method channels for Dart <> Swift communication
  • Voice command transcription uses existing WebSocket stream
  • Sends transcribed text to chat endpoint for AI response
  • Streams audio from OpenAI TTS and queues multiple responses

Tested on iPhone with AirPods - works smoothly with the phone locked.

Setup for local development:
You'll need to add your OpenAI API key to both env files:

  • Add OPENAI_API_KEY=your-key-here to app/.dev.env
  • Add OPENAI_API_KEY=your-key-here to app/.prod.env

Then run:

cd app
dart run build_runner build --delete-conflicting-outputs

@nathansudo
Copy link
Contributor

@arsenkylyshbek 👀👀👀👀

@neooriginal
Copy link
Collaborator

i believe that the functionality is required to be cross-platform. implementation for android and ios would be awesome.

@aaravgarg
Copy link
Collaborator

i believe that the functionality is required to be cross-platform. implementation for android and ios would be awesome.

what do u think of the feature in general tho?

@aaravgarg
Copy link
Collaborator

@neooriginal @nathansudo ?

@aaravgarg aaravgarg requested review from beastoin and removed request for aaravgarg October 12, 2025 22:17
@neooriginal
Copy link
Collaborator

i believe that the functionality is required to be cross-platform. implementation for android and ios would be awesome.

what do u think of the feature in general tho?

I do like the idea, it's amazing. BUT I'm not sure the massive code changes are worth it as this will make maintaining worse, especially since it's +600 lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants