Skip to content

Android: support audio sharing between phones during screen share and sound share - #187

Closed
ShivanshuKantPrasad wants to merge 1 commit into
InukaAsith:mainfrom
ShivanshuKantPrasad:feat/phone-to-phone-audio-share
Closed

ShivanshuKantPrasad wants to merge 1 commit into
InukaAsith:mainfrom
ShivanshuKantPrasad:feat/phone-to-phone-audio-share

Conversation

@ShivanshuKantPrasad

Copy link
Copy Markdown
Contributor

Summary

This PR adds support for audio sharing between phones in TwinDesk Android, both during screen sharing and as standalone audio sharing from the Sound tab.

Details & Changes

  • Audio Capture: Captures 48 kHz stereo 16-bit PCM playback audio using AudioPlaybackCaptureConfiguration in PeerCaptureService.
  • Standalone Audio Capture: Decoupled PeerCaptureService from screen streaming so audio can be shared independently without requiring a virtual display or video encoder.
  • Audio Playback: Implemented PeerAudioPlayer using AudioTrack with an 80 ms jitter pre-buffer to ensure smooth playback and prevent audio buffer underruns.
  • Protocol Coordination: Added peer.sound.want and peer.sound.state protocol messages to coordinate capture and playback between paired devices.
  • UI & Controls:
    • Show the Sound tab in peer mode with "Play {name}’s sound here" and "Play this device’s sound on {name}".
    • Added "Start the sound" button and automatic capture prompt (PeerGrantActivity) when sound sharing is enabled.
    • Subtitle displays "Playing" when audio is active.

… sound share

- Allow sharing audio between phones during screen share and via the Sound tab
- Capture 48 kHz stereo PCM audio via AudioPlaybackCaptureConfiguration in PeerCaptureService
- Support standalone sound sharing without requiring screen streaming
- Add PeerAudioPlayer with jitter buffering for smooth audio playback via AudioTrack
- Add peer.sound.want and peer.sound.state protocol messages for mutual audio coordination
- Show Sound tab and playback/capture controls in peer mode
@ShivanshuKantPrasad

Copy link
Copy Markdown
Contributor Author

Agent created it without asking me.

@ShivanshuKantPrasad

Copy link
Copy Markdown
Contributor Author

The resulting application wasn't good quality, there was bad audio quality issue.

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