Skip to content

fix(app): use actual sample rate for mix instead of hardcoded 48kHz#24

Merged
pasrom merged 1 commit intomainfrom
fix/mix-sample-rate
Mar 15, 2026
Merged

fix(app): use actual sample rate for mix instead of hardcoded 48kHz#24
pasrom merged 1 commit intomainfrom
fix/mix-sample-rate

Conversation

@pasrom
Copy link
Copy Markdown
Owner

@pasrom pasrom commented Mar 15, 2026

The output device rate can differ from 48kHz (e.g. 24kHz when meeting-simulator plays 16kHz fixtures via AVAudioPlayer). The mix was always saved at 48kHz regardless of the actual capture rate, causing 2x playback speed ("Mickey Mouse" audio).

Fix: use actualSampleRate from AudioCaptureSession for the mix WAV header. Remove unnecessary in-memory resampling of app/mic samples in DualSourceRecorder.stop() — the pipeline resamples to 16kHz later. Also simplify AppAudioCapture rate handling: query rate after device start, accept whatever CoreAudio reports.

The output device rate can differ from 48kHz (e.g. 24kHz when
meeting-simulator plays 16kHz fixtures via AVAudioPlayer). The mix
was always saved at 48kHz regardless of the actual capture rate,
causing 2x playback speed ("Mickey Mouse" audio).

Fix: use actualSampleRate from AudioCaptureSession for the mix WAV
header. Remove unnecessary in-memory resampling of app/mic samples
in DualSourceRecorder.stop() — the pipeline resamples to 16kHz later.
Also simplify AppAudioCapture rate handling: query rate after device
start, accept whatever CoreAudio reports.
@github-actions github-actions bot added the bug Something isn't working label Mar 15, 2026
@pasrom pasrom merged commit 78b3ac9 into main Mar 15, 2026
5 checks passed
@pasrom pasrom deleted the fix/mix-sample-rate branch March 15, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant