Add AudioClipDump debugging utility (dump audio buffers to WAV)#307
Open
MaxHeimbrock wants to merge 2 commits into
Open
Add AudioClipDump debugging utility (dump audio buffers to WAV)#307MaxHeimbrock wants to merge 2 commits into
MaxHeimbrock wants to merge 2 commits into
Conversation
Extracted from the microphone investigation: snapshots an AudioClip's raw contents to a 16-bit PCM WAV (plus a generic float[]-to-WAV writer and a delayed-dump coroutine helper) so buffer contents can be inspected offline. A raw dump like this was what cracked the macOS + Bluetooth HFP capture bug: it revealed FMOD writing valid 320-sample fragments at a 1024-sample stride with exact-zero padding, while GetPosition advanced 3.2x faster than the data rate — something no amount of reasoning about API values could show. Kept as a permanent internal tool for future audio debugging. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Required for stable GUIDs when the package is imported. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Standalone debugging utility extracted from the microphone capture investigation, kept for future use.
LiveKit.Internal.AudioClipDumpprovides:DumpClip(clip, fileName)— snapshot anAudioClip's full contents to a 16-bit PCM WAV inApplication.temporaryCachePath(works in editor and on device) and return the path.DumpClipAfter(clip, delaySeconds, fileName)— coroutine helper to dump a looping mic clip a few seconds after capture starts.WriteWav(path, samples, channels, sampleRate)— generic interleaved-float → WAV writer.Why keep it
A raw clip dump was what cracked the macOS + Bluetooth HFP capture bug (#306): the WAV revealed FMOD writing valid 320-sample audio fragments at a 1024-sample stride with exact-zero padding, while
Microphone.GetPositionadvanced ~3.2× faster than the data rate. No amount of reasoning about API values (clip.frequency,GetPosition) could show that — inspecting the actual buffer contents settled it in one run. This tool makes that diagnostic a one-liner next time.No behavioral changes; the class is internal and unused by the runtime path.
🤖 Generated with Claude Code