kclyu / rpi-webrtc-streamer

This repo's objective is providing something like Web Cam server on the most popular Raspberry PI hardware. By integrating [WebRTC](https://webrtc.org/native-code/) and Raspberry PI, we can stream the Raspberry camera feed to browser or native client which talks WebRTC.
Other
617 stars 108 forks source link

Help streaming audio from browser/app to RWS #104

Closed jonspieg closed 3 years ago

jonspieg commented 3 years ago

Streaming from RWS to browser/app works great. However I can't seem to figure out how to make the other direction work as well. I'm using the ReSpeaker 2-mics audio hat from seeed studio and I have no problem playing audio files with it using aplay. I've followed https://github.com/kclyu/rpi-webrtc-streamer/blob/master/README_audio.md and made sure this card&device are set as defaults in asoundrc. I wasn't sure what I was supposed to do in /lib/modprobe.d/aliases.conf I must say that it's not clear to me if this is something RWS even supports, the only pieces of information are vague posts here on the issues page.

Any help would be greatly appreciated Thanks!

kclyu commented 3 years ago

If you setup the mic capture normally in RWS, it seems that there is no problem in setting it for audio play and capture. In the RWS, the part related to mic or audio depends entirely on the alsa config, and there is no enable/disable part in rws source code.

First, I assuming that you have set it up normally. To capture the audio in the browser, you must use https. If you access video or audio device from browser, capture is not even possible without using https. However, in the app, I think it can be used without https.

jonspieg commented 3 years ago

it works great from android. thanks!