Skip to content

feat(audio): save recordings as Ogg Opus - #99

Merged
pranc1ngpegasus merged 3 commits into
mainfrom
agent/ogg-opus-recording
Jul 27, 2026
Merged

feat(audio): save recordings as Ogg Opus#99
pranc1ngpegasus merged 3 commits into
mainfrom
agent/ogg-opus-recording

Conversation

@pranc1ngpegasus

Copy link
Copy Markdown
Member

Summary

  • replace per-source WAV recording with Ogg/Opus (mic.ogg and system.ogg)
  • encode off the real-time audio callback through a bounded background queue
  • write each completed Opus packet immediately as a checksummed Ogg page
  • periodically sync completed pages and finalize the last page with EOS/granule trimming on a clean stop
  • retain legacy database field names while storing the new .ogg paths

Why

WAV writes previously happened synchronously on the audio callback and recordings depended on a clean session stop. Ogg page boundaries let completed audio remain independently recoverable when a session or process terminates unexpectedly, while Opus substantially reduces recording size.

Impact

New sessions store separate microphone and system recordings as Ogg/Opus. A clean stop drains the bounded queue and writes EOS; an abnormal stop leaves the already completed pages readable without requiring a post-processing concatenation step.

Validation

  • swift build
  • cargo fmt --all -- --check
  • cargo test -p wisp-core -p wisp-storage -p wisp-audiokit (23 tests)
  • generated a 48 kHz Opus/Ogg fixture and verified normal and EOS-truncated variants with macOS afinfo
  • full workspace tests are currently blocked in this environment because the Xcode Metal compiler is unavailable

@pranc1ngpegasus
pranc1ngpegasus marked this pull request as ready for review July 27, 2026 07:14
@pranc1ngpegasus
pranc1ngpegasus merged commit fc6084a into main Jul 27, 2026
5 checks passed
@pranc1ngpegasus
pranc1ngpegasus deleted the agent/ogg-opus-recording branch July 27, 2026 07:14
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.

1 participant