@@ -77,15 +77,24 @@ - (instancetype)init {
7777 NSLog (@" Both audioProcessingModule and audioDevice are provided, but only one can be used. Ignoring audioDevice." );
7878 }
7979 RCTLogInfo (@" Using audio processing module: %@ " , NSStringFromClass ([audioProcessingModule class ]));
80- _peerConnectionFactory = [[RTCPeerConnectionFactory alloc ] initWithBypassVoiceProcessing: NO
81- encoderFactory: encoderFactory
82- decoderFactory: decoderFactory
83- audioProcessingModule: audioProcessingModule];
84- } else {
85- RCTLogInfo (@" Using audio device: %@ " , NSStringFromClass ([audioDevice class ]));
80+ _peerConnectionFactory =
81+ [[RTCPeerConnectionFactory alloc ] initWithAudioDeviceModuleType: RTCAudioDeviceModuleTypePlatformDefault
82+ bypassVoiceProcessing: NO
83+ encoderFactory: encoderFactory
84+ decoderFactory: decoderFactory
85+ audioProcessingModule: audioProcessingModule];
86+ } else if (audioDevice != nil ) {
87+ RCTLogInfo (@" Using custom audio device: %@ " , NSStringFromClass ([audioDevice class ]));
8688 _peerConnectionFactory = [[RTCPeerConnectionFactory alloc ] initWithEncoderFactory: encoderFactory
8789 decoderFactory: decoderFactory
8890 audioDevice: audioDevice];
91+ } else {
92+ _peerConnectionFactory =
93+ [[RTCPeerConnectionFactory alloc ] initWithAudioDeviceModuleType: RTCAudioDeviceModuleTypePlatformDefault
94+ bypassVoiceProcessing: NO
95+ encoderFactory: encoderFactory
96+ decoderFactory: decoderFactory
97+ audioProcessingModule: nil ];
8998 }
9099
91100 _peerConnections = [NSMutableDictionary new ];
0 commit comments