Closed vria closed 2 years ago
Today it is possible to chose audio input / audio output device on the configuration page. However this choice is ignored when it comes to PeerConnectionClient, the application always uses the default OS settings.
It's possible. Should be a one-liner or so. Currently I'm working on another project, but soon I will update the api.
The bottom line of this feature is to enable multiple audio tracks that are backed by multiple audio input devices. Is there a way to achieve this in current code ? If not, what improvement could you imagine ?
You can do this by adding multiple MediaStreamTracks to the RTCPeerConnection (addTrack or addTransceiver).
With the current state you could create individual MediaSources for the MediaStreamTracks.
Hi @devopvoid, hope you are doing well.
If you don't have time to work on this issue I could take care of it.
I think PeerConnectionClient::addAudio method lacks the code similar to addVideo
:
AudioConfiguration audioConfig = config.getAudioConfiguration();
AudioDevice device = audioConfig.getRecordingDevice();
audioSource = new AudioDeviceSource();
audioSource.setAudioCaptureDevice(device);
But there is no such class as AudioDeviceSource
where we can specify arbitrary audio recording device. Do you think it worth creating ? Could it be backed by C++ objetcs ?
Hi @vria, sorry for the late response!
In the current state of the project you can choose the audio recording and playback device by providing a AudioDeviceModule
to the PeerConnectionFactory
constructor. That way, I just mirrored the native API.
As for multiple arbitrary audio sources one have to implement the corresponding native code as well. If you are willing to do that, you are more than welcome :-)
I'll have a look into that, maybe there is better support by the API now. I just switched to the latest WebRTC version.
This is now possible with the AudioDeviceModule
passed to the PeerConnectionFactory
.
var audioDevModule = new AudioDeviceModule();
audioDevModule.setPlayoutDevice(...)
or audioDevModule.setRecordingDevice(...)
audioDevModule.initPlayout()
or audioDevModule.initRecording()
This step is important, otherwise the PeerConnection won't select your device.var factory = new PeerConnectionFactory(audioDevModule);
Hi,
first of all thank you for this fascinating project!
Today it is possible to chose audio input / audio output device on the configuration page. However this choice is ignored when it comes to
PeerConnectionClient
, the application always uses the default OS settings.The bottom line of this feature is to enable multiple audio tracks that are backed by multiple audio input devices. Is there a way to achieve this in current code ? If not, what improvement could you imagine ?
Thanks !