Skip to content

Feature Request: Support for programmatically injecting/intercepting WebRTC audio streams in call.offer and call.accept #3495

Description

@uriva

Describe the feature you'd like
Currently, the WPP.call module supports basic call controls such as WPP.call.offer, WPP.call.accept, and WPP.call.reject. While this allows triggering the browser's native call interface (dialing/answering), there is currently no built-in way to programmatically read or write the raw media streams (such as audio/video).

It would be highly valuable to have a way to programmatically:

  1. Inject a custom audio stream (e.g., from a virtual microphone or raw buffer) into an outgoing call initiated by call.offer or an accepted call via call.accept.
  2. Intercept and extract the incoming remote audio stream (the caller's voice) as a raw audio buffer/stream.

Under the hood, this could theoretically be achieved by:

  • Overriding/hooking into navigator.mediaDevices.getUserMedia when a call is made to inject a custom MediaStream (e.g., controlled via Web Audio API).
  • Intercepting the remote MediaStreamTrack from the active RTCPeerConnection instance and piping the raw audio chunks (e.g., PCM) back.

Would you accept a PR?
I am interested in exploring a potential solution for this. Before diving into implementation details or submitting code, I wanted to check:

  1. Is this a feature you would be open to accepting a PR for?
  2. Have you already explored or discussed a specific architectural approach for bridging live media streams between the Node/Puppeteer layer and the injected client-side script?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions