[Feature] Implement Real-time Audio Streaming from HFP to Web Client#61
Draft
[Feature] Implement Real-time Audio Streaming from HFP to Web Client#61
Conversation
Co-authored-by: albal <2963080+albal@users.noreply.github.com>
Co-authored-by: albal <2963080+albal@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [Feature Request] Real-time Audio Streaming from HFP to Web Client
[Feature] Implement Real-time Audio Streaming from HFP to Web Client
Jul 11, 2025
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.
This PR implements a comprehensive real-time audio streaming feature that allows streaming live phone call audio from ESP32's Bluetooth HFP connection directly to web browsers via WebSocket connections.
🎧 Overview
The implementation transforms RemoteHead from a simple call control device into a sophisticated audio streaming platform, enabling users to monitor or participate in phone calls directly from a web interface.
🚀 Key Features
ESP32 Firmware Enhancements
/wsendpoint for real-time audio streamingesp_hf_client_register_data_callback()to capture raw PCM audioWeb Interface Improvements
Technical Specifications
🏗️ Architecture
The implementation follows a clean separation of concerns:
📸 User Interface
The enhanced interface features:
🧪 Testing & Quality Assurance
test_audio_streaming.cwith 10+ test cases📝 Documentation
docs/AUDIO_STREAMING.mdwith usage instructions🔧 Usage
🛠️ Files Modified
main/main.c- Core audio streaming implementation (WebSocket handler, HFP callback)main/main.h- Function declarations and prototypesspiffs/index.html- Enhanced control center with audio streaming accessspiffs/audio_streaming.html- Dedicated professional streaming interfacetest/main/test_audio_streaming.c- Comprehensive test suitetest/main/test_main.c- Updated to include audio streaming testsdocs/AUDIO_STREAMING.md- Complete feature documentation🔒 Security & Performance
🔮 Future Enhancements
This implementation maintains full backward compatibility while adding powerful new audio streaming capabilities that transform the user experience from simple call control to immersive audio monitoring.
Fixes #42.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.