Conversation
| if (audioProcessingModule != nil) { | ||
| if (audioDevice != nil) { | ||
| NSLog(@"Both audioProcessingModule and audioDevice are provided, but only one can be used. Ignoring " | ||
| @"audioDevice."); | ||
| } | ||
| if (audioDevice == nil) { | ||
| RCTLogInfo(@"Using audio processing module: %@", NSStringFromClass([audioProcessingModule class])); | ||
| _peerConnectionFactory = | ||
| [[RTCPeerConnectionFactory alloc] initWithAudioDeviceModuleType:RTCAudioDeviceModuleTypeAudioEngine | ||
| bypassVoiceProcessing:NO | ||
| encoderFactory:encoderFactory | ||
| decoderFactory:decoderFactory | ||
| audioProcessingModule:audioProcessingModule]; | ||
| } else { | ||
| RCTLogInfo(@"Using audio device: %@", NSStringFromClass([audioDevice class])); | ||
| _peerConnectionFactory = [[RTCPeerConnectionFactory alloc] initWithEncoderFactory:encoderFactory | ||
| decoderFactory:decoderFactory | ||
| audioDevice:audioDevice]; | ||
| } |
There was a problem hiding this comment.
Logic updated to prefer to use RTCAudioDeviceModuleTypeAudioEngine unless audioDevice is provided.
Bump the WebRTC-SDK version from 137.7151.09 to 137.7151.11 in the podspec to use the latest compatible release.
| * iOS/macOS only. | ||
| */ | ||
| class AudioDeviceModuleEventEmitter { | ||
| private eventEmitter: NativeEventEmitter | null = null; |
There was a problem hiding this comment.
There's some legacy reasons here, but use EventEmitter instead of NativeEventEmitter. It turns out that the listener registration is async on NativeEventEmitter, which can cause some unexpected behavior.
You'll need to add the valid event names here:
react-native-webrtc/src/EventEmitter.ts
Line 11 in 7beff6a
| /** | ||
| * Subscribe to speech activity events (started/ended) | ||
| */ | ||
| addSpeechActivityListener(listener: (data: SpeechActivityEventData) => void) { |
There was a problem hiding this comment.
Also implement the corresponding remove listener.
| /** | ||
| * Subscribe to devices updated event (input/output devices changed) | ||
| */ | ||
| addDevicesUpdatedListener(listener: () => void) { |
There was a problem hiding this comment.
Also implement the corresponding remove listener.
| s.libraries = 'c', 'sqlite3', 'stdc++' | ||
| s.framework = 'AudioToolbox','AVFoundation', 'CoreAudio', 'CoreGraphics', 'CoreVideo', 'GLKit', 'VideoToolbox' | ||
| s.dependency 'React-Core' | ||
| s.dependency 'WebRTC-SDK', '=137.7151.09' |
There was a problem hiding this comment.
Will probably need to rebase/update this.
No description provided.