just_audio icon indicating copy to clipboard operation
just_audio copied to clipboard

Provide Raw Audio Data Capture from AudioPlayers

Open Sungray opened this issue 6 months ago • 3 comments

Is your feature request related to a problem? Please describe. I need to capture raw audio data from AudioPlayer instances to send the app's audio to external services such as Discord or a WebSocket server.

Describe the solution you'd like Implement a mechanism to allow users to register callbacks to AudioPlayer instances that provide access to the audio data buffers being processed. These callbacks should be invoked with the raw PCM data at the same point where the audio is sent to the output. The library should expose the audio data in a standard PCM format, such as PCM 16-bit or PCM 32-bit float, so that it can be processed or streamed as needed.

Describe alternatives you've considered I implemented the Audio Playback Capture API to capture the app's audio and process the PCM stream correctly. However, any effects applied to the AudioPlayer instances, such as volume changes, are ignored. This is problematic when managing multiple AudioPlayer instances with different volume levels and effects. Synchronizing volumes natively is not feasible in this scenario.

Additional context No additional context.

Sungray avatar Aug 04 '24 09:08 Sungray