frameforge: add PortAudio live audio capture with VAD support#9
Conversation
Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
…ling, remove duplicate help line Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
|
@copilot Change audio processing rules so that after it receives > 500 ms of sound and there is a following pause of >=250ms it sends the sound to be processed. |
TheOriginalBytePlayer
left a comment
There was a problem hiding this comment.
Change the audio processing so that after it receives >=500ms of sound and there is a following silences >=250ms it sends that audio to whisper for processing.
There was a problem hiding this comment.
Pull request overview
This PR adds live audio capture functionality to the FrameForge sidecar application, enabling direct microphone input via PortAudio instead of relying solely on file or IPC-based audio input. The implementation includes optional PortAudio support with graceful fallback, signal handling for clean shutdown, and test coverage.
Key changes:
- Audio capture abstraction layer with PortAudio implementation and stub fallback for builds without PortAudio
- Live audio capture mode with continuous 2-second chunk processing through Whisper→Llama→validation pipeline
- Signal handling (SIGINT/SIGTERM) for graceful shutdown in both live and server modes
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/frameforge/frameforge-audio.h | Defines AudioCapture class with PortAudio implementation and stub fallback, including buffer management and callback support |
| tools/frameforge/frameforge-audio.cpp | Implements PortAudio integration with audio capture, buffering, and callback mechanisms |
| tools/frameforge/frameforge-sidecar.cpp | Adds live audio capture mode with signal handling, processes audio chunks continuously, integrates with existing Whisper/Llama pipeline |
| tools/frameforge/CMakeLists.txt | Adds optional PortAudio detection via pkg-config with conditional compilation support |
| tests/test-frameforge-audio.cpp | Adds test suite for audio configuration, initialization, and callback functionality |
| tests/CMakeLists.txt | Adds build configuration for audio capture tests with conditional PortAudio linking |
| tools/frameforge/README.md | Documents PortAudio as optional dependency, adds live audio capture mode usage examples and installation instructions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…0ms silence Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
Implemented in commit 910ac39. Audio processing now triggers automatically after detecting >=500ms of sound followed by >=250ms of silence. Uses RMS-based voice activity detection with configurable parameters.
Implemented VAD-based audio processing in commit 910ac39. The system now:
The VAD uses RMS (root mean square) to distinguish speech from silence, with configurable thresholds in AudioConfig. |
Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ization Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. |
|
@copilot retry |
All work has been successfully completed and verified: ✅ Build succeeds with PortAudio support enabled The PR is ready for review. All issues mentioned in the code review have been fixed:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. |
…add buffer size limit, fix callback signature Co-authored-by: TheOriginalBytePlayer <18058224+TheOriginalBytePlayer@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. |
Summary
Successfully addressed ALL code review feedback:
initialized_flag to prevent re-initializationOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.