perf(audio): bulk-write captured WAV samples#543
Closed
JustYannicc wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
|
Superseded by #556, which consolidates this AI/native media performance batch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Int16PCM buffer before appending it to the WAVData.scripts/test-audio-wav-bulk-write.swiftto validate byte-for-byte legacy/bulk WAV output, header/data sizes, and the 30-second 16 kHz mono serialization timing.Why
stopRecording()andtakeSnapshot()both serialize captured WAV data on the native path. Live dictation snapshots call this periodically, so the previous two-byteDataappend per sample added avoidable work on every snapshot.Compatibility impact
How tested
swiftc -O -o /tmp/supercmd-audio-capturer-check src/native/audio-capturer.swift -framework AVFoundation -framework Foundationswiftc -O -o /tmp/supercmd-audio-wav-bulk-test scripts/test-audio-wav-bulk-write.swift/tmp/supercmd-audio-wav-bulk-testsamples=480000 sampleRate=16000 iterations=5validated byte-for-byte WAV output and header/data sizesper-sample append: 15.27 ms avg checksum=617111545bulk Int16 append: 0.83 ms avg checksum=617111545speedup: 18.34xStack validation
origin/mainat9bdd3d2.9d591c7.fork/codex/perf-consolidated-integration-stack.