iOS fitness coach app with OpenAI Realtime API voice conversation.
- ✅ Real-time voice conversation with AI fitness coach
- ✅ AudioUnit with VoiceProcessingIO for echo cancellation
- ✅ Server-side VAD (Voice Activity Detection)
- ✅ Natural interruption support (barge-in)
- ✅ Animated ring UI (glistens when listening, pulses when speaking)
- ✅ Auto-start recording when ready
git clone https://github.com/nidzae/FitnessCoachVoice-iOS.git
cd FitnessCoachVoice-iOS/FitnessCoachAI# Copy the template config file
cp Config.template.xcconfig Config.xcconfig
# Edit Config.xcconfig and add your OpenAI API key
# Replace YOUR_OPENAI_API_KEY_HERE with your actual keyopen FitnessCoachAI.xcodeproj- Select your target device/simulator
- Press ⌘R to build and run
FitnessCoachAI/
├── Models/
│ └── VoiceAgentState.swift # App state model
├── Services/
│ ├── AudioManager.swift # AudioUnit recording + AVAudioEngine playback
│ └── OpenAIVoiceService.swift # WebSocket connection to OpenAI Realtime API
├── ViewModels/
│ └── VoiceCoachViewModel.swift # Business logic and state management
└── Views/
├── HomeView.swift # Main screen
├── VoiceRingView.swift # Animated ring component
└── VoiceAvatarView.swift # (Legacy, replaced by VoiceRingView)
- AudioUnit with VoiceProcessingIO: Hardware-level echo cancellation
- OpenAI Realtime API: GPT-based voice conversation
- Server VAD: Automatic speech detection and turn management
- SwiftUI: Modern UI with custom animations
Config.xcconfig- Your actual API keys (ignored by git)Config.template.xcconfig- Template for new developers (committed to git).gitignore- Ensures sensitive files aren't committed
- Working voice conversation with realtime only
- No video or camera implementation
- Mic auto-starts when session is ready
- Echo cancellation prevents the agent from hearing itself
Private project