@livekit/react-native 2.6.3 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,30 +24,25 @@ object LiveKitReactNative {
|
|
|
24
24
|
|
|
25
25
|
val audioDeviceModule: JavaAudioDeviceModule
|
|
26
26
|
get() {
|
|
27
|
-
|
|
27
|
+
return this.adm
|
|
28
28
|
?: throw IllegalStateException("Audio device module is not initialized! Did you remember to call LiveKitReactNative.setup in your Application.onCreate?")
|
|
29
|
-
return adm
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
private
|
|
31
|
+
private var _audioProcessingController: CustomAudioProcessingController? = null
|
|
33
32
|
|
|
34
33
|
val audioProcessingController: AudioProcessingController
|
|
35
34
|
get() {
|
|
36
|
-
|
|
37
|
-
throw IllegalStateException("audioProcessingController is not initialized! Did you remember to call LiveKitReactNative.setup in your Application.onCreate?")
|
|
38
|
-
}
|
|
39
|
-
return _audioProcessingController
|
|
35
|
+
return this._audioProcessingController
|
|
36
|
+
?: throw IllegalStateException("audioProcessingController is not initialized! Did you remember to call LiveKitReactNative.setup in your Application.onCreate?")
|
|
40
37
|
}
|
|
41
38
|
|
|
42
39
|
|
|
43
|
-
|
|
40
|
+
private var _audioRecordSamplesDispatcher: AudioRecordSamplesDispatcher? = null
|
|
44
41
|
|
|
45
42
|
val audioRecordSamplesDispatcher: AudioRecordSamplesDispatcher
|
|
46
43
|
get() {
|
|
47
|
-
|
|
44
|
+
return this._audioRecordSamplesDispatcher ?:
|
|
48
45
|
throw IllegalStateException("audioRecordSamplesDispatcher is not initialized! Did you remember to call LiveKitReactNative.setup in your Application.onCreate?")
|
|
49
|
-
}
|
|
50
|
-
return _audioRecordSamplesDispatcher
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
|
|
@@ -73,6 +68,13 @@ object LiveKitReactNative {
|
|
|
73
68
|
|
|
74
69
|
setupAdm(context)
|
|
75
70
|
options.audioDeviceModule = adm
|
|
71
|
+
// CustomAudioProcessingController can't be instantiated before WebRTC is loaded.
|
|
72
|
+
options.audioProcessingFactoryFactory = Callable {
|
|
73
|
+
val apc = CustomAudioProcessingController()
|
|
74
|
+
_audioProcessingController = apc
|
|
75
|
+
return@Callable apc.externalAudioProcessor
|
|
76
|
+
}
|
|
77
|
+
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
private fun setupAdm(context: Context) {
|
|
@@ -94,15 +96,11 @@ object LiveKitReactNative {
|
|
|
94
96
|
adm?.release()
|
|
95
97
|
adm = null
|
|
96
98
|
|
|
99
|
+
_audioProcessingController = null
|
|
100
|
+
|
|
101
|
+
// adm needs to be re-setup with a new one each time.
|
|
97
102
|
setupAdm(context)
|
|
98
103
|
options.audioDeviceModule = adm
|
|
99
104
|
|
|
100
|
-
// CustomAudioProcessingController can't be instantiated before WebRTC is loaded.
|
|
101
|
-
options.audioProcessingFactoryFactory = Callable {
|
|
102
|
-
val apc = CustomAudioProcessingController()
|
|
103
|
-
_audioProcessingController = apc
|
|
104
|
-
return@Callable apc.externalAudioProcessor
|
|
105
|
-
}
|
|
106
|
-
|
|
107
105
|
}
|
|
108
106
|
}
|