This project implements a real-time Delayed Auditory Feedback (DAF) system on iOS using SwiftUI, AVFoundation, and Accelerate.
The app measures the device’s loopback latency and automatically compensates it to ensure accurate feedback delay for speech research and clinical testing.
- Measures internal audio latency by playing and recording an impulse, then calculating the delay using cross-correlation (vDSP).
- Applies user-defined DAF delay (50–200 ms) by adjusting an AVAudioUnitDelay node to achieve precise total feedback timing.
- Simple SwiftUI interface for:
- Measuring latency
- Setting desired delay
- Starting/stopping DAF in real time
- Tap “Measure Latency” to automatically determine internal device delay.
- Enter a desired delay between 50–200 ms.
- Press “Start DAF” to begin delayed feedback; “Stop DAF” to end.
Requires testing on a real iOS device (not the simulator). For best accuracy, use a USB or wired microphone such as the RØDE AI-Micro.
- SwiftUI – modern iOS UI framework
- AVFoundation – audio engine and delay control
- Accelerate (vDSP) – signal correlation and latency estimation
Liwei Wang
Ph.D. Candidate, Electrical & Computer Engineering
Western University, Canada