New Component: streamlit-webrtc, a new way to deal with real-time media streams

I have a question:
Is it possible to change the audio input device from microphone to audio out/speakers ?
Such that somethin can be played and worked with like you can do with the voice from the mic?

WEBRTC_CLIENT_SETTINGS is not passed to webrtc_streamer.

iceServers information provided via client_settings argument of webrtc_streamer() is necessary to establish the connection over the Internet.
To know about these stuff, see Python WebRTC basics with aiortc - DEV Community or google keywords like “ICE” or “STUN” with “WebRTC”.

2 Likes

Is it possible to change the audio input device from microphone to audio out/speakers ?

You can select the input audio device from “SELECT DEVICE” button, but I can’t understand what changing the input device to speakers means.
At least I think it’s not streamlit-webrtc's duty.

Such that somethin can be played and worked with like you can do with the voice from the mic?

You can play audio files via MediaPlayer object and apply processing to its stream. See the app.py for the usage.
However I can’t understand how it relates to the question above.

1 Like

@whitphx Thanks. It fixed the problem when I deploy in Google cloud it still exists.

Hi community,

A new version, v0.24 has been released.
With this version, more flexible stream connections become possible, such as forking and mixing.

A new sample code app_multi.py shows such forking and mixing functionality:

A single input are forked to multiple outputs with different filters:

Multiple inputs with different filters are mixed to a single output:

In addition, app_videochat.py is also an interesting example. Forking and mixing media streams are necessary parts for building a video chat system, in combination with streamlit-server-state, which enables communication across sessions.

Please also see A video chat app with realtime snapchat-like filters! for video chat apps!

2 Likes