Passing Video Callback Function to Audio Callback Function

Summary

Is there a way to pass the returned frame from video callback to audio callback for further processing within the same webrtc_streamer?

Also, if possible, can we pass a webrtc_streamer.audio_receiver to another webrtc_streamer instance?

Example

I want to do something like this

webrtc_streamer(....,queued_audio_frames_callback=queued_audio_frames_callback(some_other_callback_function))

If applicable, please provide the steps we should take.

Hi @Anis

Both video and audio input/output can be processed via the av.VideoFrame and av.AudioFrame of PyAV library.

A few examples of processing video frames are provided in the package’s GitHub repo (GitHub - whitphx/streamlit-webrtc: Real-time video and audio streams over the network, with Streamlit.) and the same concept can be applied to audio.

Hope this helps!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.