gravix-rtc-react-native 0.0.0-stage → 0.2.0
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.
- package/CHANGELOG.md +134 -0
- package/LICENSE +20 -0
- package/LICENSES/Apache-2.0.txt +175 -0
- package/NOTICE +68 -0
- package/README.md +313 -2
- package/android/build.gradle +137 -0
- package/android/consumer-rules.pro +29 -0
- package/android/src/main/AndroidManifest.xml +9 -0
- package/android/src/main/cpp/CMakeLists.txt +48 -0
- package/android/src/main/cpp/gx_dfn_engine.c +332 -0
- package/android/src/main/cpp/gx_fx_jni.cpp +34 -0
- package/android/src/main/cpp/gx_ns_jni.c +162 -0
- package/android/src/main/cpp/third_party/onnxruntime/LICENSE +21 -0
- package/android/src/main/cpp/third_party/onnxruntime/include/onnxruntime_c_api.h +9227 -0
- package/android/src/main/cpp/third_party/onnxruntime/include/onnxruntime_ep_c_api.h +3315 -0
- package/android/src/main/cpp/third_party/onnxruntime/include/onnxruntime_error_code.h +98 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/GravixAudioHooks.kt +144 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/GravixAudioModule.kt +105 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/GravixNativeAudio.kt +310 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/GravixRtc.kt +134 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/GravixRtcModule.kt +176 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/GravixRtcPackage.kt +39 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioDeviceKind.java +44 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioManagerUtils.kt +120 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioSwitchManager.java +270 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioType.kt +50 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicCaptureRouter.kt +375 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicDecoder.kt +339 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicInterruptionWatcher.kt +82 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicMicRelease.kt +117 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicMixKernel.kt +191 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicMixerEngine.kt +617 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/AudioRoutePolicy.kt +137 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GravixCaptureProcessing.kt +67 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxCaptureDump.kt +143 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxCaptureSwitcher.kt +196 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNoiseProcessor.kt +795 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNsLogic.kt +180 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNsNative.kt +83 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNsStudio.kt +372 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxRecordStartGuard.kt +76 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxRecorderSeam.kt +434 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxSingerSource.kt +37 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxVoiceFx.kt +160 -0
- package/android/src/main/java/com/gravitycompile/gravixrtc/processing/OtherAppAudioPolicy.kt +143 -0
- package/android/src/main/java/org/webrtc/audio/WebRtcAudioTrackHelper.kt +43 -0
- package/docs/ANDROID_NATIVE_HOOKS.md +102 -0
- package/docs/FEATURE_MATRIX.md +192 -0
- package/docs/IOS_NATIVE_HOOKS.md +190 -0
- package/gravix-rtc-react-native.podspec +49 -0
- package/ios/GravixRtc.h +7 -0
- package/ios/GravixRtc.mm +273 -0
- package/ios/GravixRtcSetup.h +29 -0
- package/ios/GravixRtcSetup.m +52 -0
- package/ios/audio/GravixRtcIosAudio.m +157 -0
- package/ios/audio/GxAudioDevice.h +62 -0
- package/ios/audio/GxAudioDevice.m +857 -0
- package/ios/audio/GxAudioSetup.h +34 -0
- package/ios/audio/GxAudioSetup.m +70 -0
- package/ios/audio/GxCompat.swift +53 -0
- package/ios/audio/GxIosAudio.swift +99 -0
- package/ios/audio/GxMusicController.swift +150 -0
- package/ios/audio/GxMusicPost.swift +362 -0
- package/ios/audio/GxNoiseProcessor.swift +718 -0
- package/ios/audio/GxNsDfn3CoreML.swift +195 -0
- package/ios/audio/GxNsStudioEngine.swift +237 -0
- package/ios/audio/GxNsStudioPack.swift +212 -0
- package/ios/audio/GxVoiceFx.swift +161 -0
- package/ios/audio/gx_adm_state.h +153 -0
- package/ios/gxcore/apple/gx_music_post.c +312 -0
- package/ios/gxcore/apple/gx_pcm.c +30 -0
- package/ios/gxcore/apple/gxns_build.h +19 -0
- package/ios/gxcore/apple/gxns_ios.c +17 -0
- package/ios/gxcore/apple/include/gx_fx.h +3 -0
- package/ios/gxcore/apple/include/gx_music_post.h +88 -0
- package/ios/gxcore/apple/include/gx_ns.h +3 -0
- package/ios/gxcore/apple/include/gx_pcm.h +33 -0
- package/ios/gxcore/apple/include/gxns_ios.h +18 -0
- package/ios/gxcore/apple/include/module.modulemap +10 -0
- package/ios/gxcore/apple/shim/rnnoise.h +2 -0
- package/ios/gxcore/apple/shim/speex_resampler.h +2 -0
- package/ios/gxcore/apple/units/gx_fx_forward.cpp +3 -0
- package/ios/gxcore/apple/units/gx_ns.c +7 -0
- package/ios/gxcore/apple/units/gx_ns_timer.c +7 -0
- package/ios/gxcore/apple/units/rnnoise_celt_lpc.c +7 -0
- package/ios/gxcore/apple/units/rnnoise_denoise.c +7 -0
- package/ios/gxcore/apple/units/rnnoise_kiss_fft.c +7 -0
- package/ios/gxcore/apple/units/rnnoise_pitch.c +7 -0
- package/ios/gxcore/apple/units/rnnoise_rnn.c +7 -0
- package/ios/gxcore/apple/units/rnnoise_rnn_data.c +7 -0
- package/ios/gxcore/apple/units/speexdsp_resample.c +7 -0
- package/ios/resources/ns/DFN3-NOTICE.txt +10 -0
- package/ios/resources/ns/DeepFilterNet-LICENSE-APACHE +201 -0
- package/ios/resources/ns/DeepFilterNet-LICENSE-MIT +19 -0
- package/ios/resources/ns/gxns_dfn3.mlmodelc/analytics/coremldata.bin +0 -0
- package/ios/resources/ns/gxns_dfn3.mlmodelc/coremldata.bin +0 -0
- package/ios/resources/ns/gxns_dfn3.mlmodelc/metadata.json +338 -0
- package/ios/resources/ns/gxns_dfn3.mlmodelc/model.mil +927 -0
- package/ios/resources/ns/gxns_dfn3.mlmodelc/weights/weight.bin +0 -0
- package/lib/module/android/bindings.js +49 -0
- package/lib/module/android/bindings.js.map +1 -0
- package/lib/module/android/index.js +13 -0
- package/lib/module/android/index.js.map +1 -0
- package/lib/module/android/micMute.js +341 -0
- package/lib/module/android/micMute.js.map +1 -0
- package/lib/module/android/nativeAudio.js +47 -0
- package/lib/module/android/nativeAudio.js.map +1 -0
- package/lib/module/android/noiseSuppression.js +170 -0
- package/lib/module/android/noiseSuppression.js.map +1 -0
- package/lib/module/android/roomMusic.js +142 -0
- package/lib/module/android/roomMusic.js.map +1 -0
- package/lib/module/android/singerMode.js +31 -0
- package/lib/module/android/singerMode.js.map +1 -0
- package/lib/module/android/voiceEffects.js +65 -0
- package/lib/module/android/voiceEffects.js.map +1 -0
- package/lib/module/audio/AudioManager.js +79 -0
- package/lib/module/audio/AudioManager.js.map +1 -0
- package/lib/module/audio/AudioSession.js +90 -0
- package/lib/module/audio/AudioSession.js.map +1 -0
- package/lib/module/audio/remoteVolume.js +54 -0
- package/lib/module/audio/remoteVolume.js.map +1 -0
- package/lib/module/components/VideoView.js +109 -0
- package/lib/module/components/VideoView.js.map +1 -0
- package/lib/module/features/audioScenario.js +53 -0
- package/lib/module/features/audioScenario.js.map +1 -0
- package/lib/module/features/beauty.js +828 -0
- package/lib/module/features/beauty.js.map +1 -0
- package/lib/module/features/micRelease.js +89 -0
- package/lib/module/features/micRelease.js.map +1 -0
- package/lib/module/features/noiseSuppression.js +213 -0
- package/lib/module/features/noiseSuppression.js.map +1 -0
- package/lib/module/features/roomMusic.js +90 -0
- package/lib/module/features/roomMusic.js.map +1 -0
- package/lib/module/features/roomMusicAndroid.js +294 -0
- package/lib/module/features/roomMusicAndroid.js.map +1 -0
- package/lib/module/features/roomMusicIos.js +250 -0
- package/lib/module/features/roomMusicIos.js.map +1 -0
- package/lib/module/features/roomMusicTypes.js +53 -0
- package/lib/module/features/roomMusicTypes.js.map +1 -0
- package/lib/module/features/screenShare.js +22 -0
- package/lib/module/features/screenShare.js.map +1 -0
- package/lib/module/features/singerMode.js +73 -0
- package/lib/module/features/singerMode.js.map +1 -0
- package/lib/module/features/voiceEffects.js +148 -0
- package/lib/module/features/voiceEffects.js.map +1 -0
- package/lib/module/hooks/context.js +34 -0
- package/lib/module/hooks/context.js.map +1 -0
- package/lib/module/hooks/hooks.js +145 -0
- package/lib/module/hooks/hooks.js.map +1 -0
- package/lib/module/hooks/types.js +4 -0
- package/lib/module/hooks/types.js.map +1 -0
- package/lib/module/hooks/useRoomEvents.js +30 -0
- package/lib/module/hooks/useRoomEvents.js.map +1 -0
- package/lib/module/index.js +43 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/ios/autoAttach.js +14 -0
- package/lib/module/ios/autoAttach.js.map +1 -0
- package/lib/module/ios/iosAudio.js +149 -0
- package/lib/module/ios/iosAudio.js.map +1 -0
- package/lib/module/join/appStateLifecycle.js +54 -0
- package/lib/module/join/appStateLifecycle.js.map +1 -0
- package/lib/module/micPolicy.js +249 -0
- package/lib/module/micPolicy.js.map +1 -0
- package/lib/module/native/NativeGravixAudio.js +18 -0
- package/lib/module/native/NativeGravixAudio.js.map +1 -0
- package/lib/module/native/NativeGravixRtc.js +13 -0
- package/lib/module/native/NativeGravixRtc.js.map +1 -0
- package/lib/module/native/module.js +23 -0
- package/lib/module/native/module.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/polyfills/DOMException.js +22 -0
- package/lib/module/polyfills/DOMException.js.map +1 -0
- package/lib/module/polyfills/early.js +18 -0
- package/lib/module/polyfills/early.js.map +1 -0
- package/lib/module/polyfills/event.js +71 -0
- package/lib/module/polyfills/event.js.map +1 -0
- package/lib/module/polyfills/sha256.js +92 -0
- package/lib/module/polyfills/sha256.js.map +1 -0
- package/lib/module/polyfills/subtleHmac.js +91 -0
- package/lib/module/polyfills/subtleHmac.js.map +1 -0
- package/lib/module/polyfills/textCoding.js +164 -0
- package/lib/module/polyfills/textCoding.js.map +1 -0
- package/lib/module/registerGlobals.js +135 -0
- package/lib/module/registerGlobals.js.map +1 -0
- package/lib/module/unsupported.js +90 -0
- package/lib/module/unsupported.js.map +1 -0
- package/lib/module/version.js +7 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/android/bindings.d.ts +14 -0
- package/lib/typescript/src/android/bindings.d.ts.map +1 -0
- package/lib/typescript/src/android/index.d.ts +9 -0
- package/lib/typescript/src/android/index.d.ts.map +1 -0
- package/lib/typescript/src/android/micMute.d.ts +124 -0
- package/lib/typescript/src/android/micMute.d.ts.map +1 -0
- package/lib/typescript/src/android/nativeAudio.d.ts +40 -0
- package/lib/typescript/src/android/nativeAudio.d.ts.map +1 -0
- package/lib/typescript/src/android/noiseSuppression.d.ts +48 -0
- package/lib/typescript/src/android/noiseSuppression.d.ts.map +1 -0
- package/lib/typescript/src/android/roomMusic.d.ts +80 -0
- package/lib/typescript/src/android/roomMusic.d.ts.map +1 -0
- package/lib/typescript/src/android/singerMode.d.ts +27 -0
- package/lib/typescript/src/android/singerMode.d.ts.map +1 -0
- package/lib/typescript/src/android/voiceEffects.d.ts +30 -0
- package/lib/typescript/src/android/voiceEffects.d.ts.map +1 -0
- package/lib/typescript/src/audio/AudioManager.d.ts +32 -0
- package/lib/typescript/src/audio/AudioManager.d.ts.map +1 -0
- package/lib/typescript/src/audio/AudioSession.d.ts +70 -0
- package/lib/typescript/src/audio/AudioSession.d.ts.map +1 -0
- package/lib/typescript/src/audio/remoteVolume.d.ts +8 -0
- package/lib/typescript/src/audio/remoteVolume.d.ts.map +1 -0
- package/lib/typescript/src/components/VideoView.d.ts +44 -0
- package/lib/typescript/src/components/VideoView.d.ts.map +1 -0
- package/lib/typescript/src/features/audioScenario.d.ts +24 -0
- package/lib/typescript/src/features/audioScenario.d.ts.map +1 -0
- package/lib/typescript/src/features/beauty.d.ts +377 -0
- package/lib/typescript/src/features/beauty.d.ts.map +1 -0
- package/lib/typescript/src/features/micRelease.d.ts +28 -0
- package/lib/typescript/src/features/micRelease.d.ts.map +1 -0
- package/lib/typescript/src/features/noiseSuppression.d.ts +64 -0
- package/lib/typescript/src/features/noiseSuppression.d.ts.map +1 -0
- package/lib/typescript/src/features/roomMusic.d.ts +41 -0
- package/lib/typescript/src/features/roomMusic.d.ts.map +1 -0
- package/lib/typescript/src/features/roomMusicAndroid.d.ts +60 -0
- package/lib/typescript/src/features/roomMusicAndroid.d.ts.map +1 -0
- package/lib/typescript/src/features/roomMusicIos.d.ts +56 -0
- package/lib/typescript/src/features/roomMusicIos.d.ts.map +1 -0
- package/lib/typescript/src/features/roomMusicTypes.d.ts +76 -0
- package/lib/typescript/src/features/roomMusicTypes.d.ts.map +1 -0
- package/lib/typescript/src/features/screenShare.d.ts +12 -0
- package/lib/typescript/src/features/screenShare.d.ts.map +1 -0
- package/lib/typescript/src/features/singerMode.d.ts +20 -0
- package/lib/typescript/src/features/singerMode.d.ts.map +1 -0
- package/lib/typescript/src/features/voiceEffects.d.ts +46 -0
- package/lib/typescript/src/features/voiceEffects.d.ts.map +1 -0
- package/lib/typescript/src/hooks/context.d.ts +12 -0
- package/lib/typescript/src/hooks/context.d.ts.map +1 -0
- package/lib/typescript/src/hooks/hooks.d.ts +54 -0
- package/lib/typescript/src/hooks/hooks.d.ts.map +1 -0
- package/lib/typescript/src/hooks/types.d.ts +8 -0
- package/lib/typescript/src/hooks/types.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useRoomEvents.d.ts +13 -0
- package/lib/typescript/src/hooks/useRoomEvents.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +37 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/ios/autoAttach.d.ts +2 -0
- package/lib/typescript/src/ios/autoAttach.d.ts.map +1 -0
- package/lib/typescript/src/ios/iosAudio.d.ts +96 -0
- package/lib/typescript/src/ios/iosAudio.d.ts.map +1 -0
- package/lib/typescript/src/join/appStateLifecycle.d.ts +14 -0
- package/lib/typescript/src/join/appStateLifecycle.d.ts.map +1 -0
- package/lib/typescript/src/micPolicy.d.ts +104 -0
- package/lib/typescript/src/micPolicy.d.ts.map +1 -0
- package/lib/typescript/src/native/NativeGravixAudio.d.ts +21 -0
- package/lib/typescript/src/native/NativeGravixAudio.d.ts.map +1 -0
- package/lib/typescript/src/native/NativeGravixRtc.d.ts +31 -0
- package/lib/typescript/src/native/NativeGravixRtc.d.ts.map +1 -0
- package/lib/typescript/src/native/module.d.ts +7 -0
- package/lib/typescript/src/native/module.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/DOMException.d.ts +3 -0
- package/lib/typescript/src/polyfills/DOMException.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/early.d.ts +2 -0
- package/lib/typescript/src/polyfills/early.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/event.d.ts +2 -0
- package/lib/typescript/src/polyfills/event.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/sha256.d.ts +3 -0
- package/lib/typescript/src/polyfills/sha256.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/subtleHmac.d.ts +37 -0
- package/lib/typescript/src/polyfills/subtleHmac.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/textCoding.d.ts +36 -0
- package/lib/typescript/src/polyfills/textCoding.d.ts.map +1 -0
- package/lib/typescript/src/registerGlobals.d.ts +42 -0
- package/lib/typescript/src/registerGlobals.d.ts.map +1 -0
- package/lib/typescript/src/unsupported.d.ts +42 -0
- package/lib/typescript/src/unsupported.d.ts.map +1 -0
- package/lib/typescript/src/version.d.ts +3 -0
- package/lib/typescript/src/version.d.ts.map +1 -0
- package/metro/index.js +39 -0
- package/metro/noise-stub.js +10 -0
- package/native/gxfx/include/gx_fx.h +82 -0
- package/native/gxfx/src/gx_fx.cpp +527 -0
- package/native/gxfx/third_party/README.md +4 -0
- package/native/gxfx/third_party/signalsmith-linear/LICENSE.txt +21 -0
- package/native/gxfx/third_party/signalsmith-linear/approx.h +191 -0
- package/native/gxfx/third_party/signalsmith-linear/fft.h +1386 -0
- package/native/gxfx/third_party/signalsmith-linear/linear.h +1129 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/approx-cmsisdsp.h +40 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/basic-fill-warnings.h +61 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/fft-accelerate.h +340 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/fft-cmsisdsp.h +307 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/fft-ipp.h +532 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/fft-linear.h +213 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/fft-pffft-double.h +221 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/fft-pffft.h +221 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/linear-accelerate.h +593 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/linear-cmsisdsp.h +713 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/linear-xsimd-dispatch.cpp +6 -0
- package/native/gxfx/third_party/signalsmith-linear/platform/linear-xsimd.h +818 -0
- package/native/gxfx/third_party/signalsmith-linear/stft.h +700 -0
- package/native/gxfx/third_party/signalsmith-stretch-LICENSE.txt +21 -0
- package/native/gxfx/third_party/signalsmith-stretch.h +1060 -0
- package/native/gxns/CMakeLists.txt +67 -0
- package/native/gxns/include/gx_ns.h +285 -0
- package/native/gxns/src/gx_ns.c +1518 -0
- package/native/gxns/src/gx_ns_timer.c +84 -0
- package/native/gxns/src/gx_ns_timer.h +29 -0
- package/native/gxns/third_party/VENDOR.md +43 -0
- package/native/gxns/third_party/rnnoise/AUTHORS +1 -0
- package/native/gxns/third_party/rnnoise/COPYING +31 -0
- package/native/gxns/third_party/rnnoise/include/rnnoise.h +117 -0
- package/native/gxns/third_party/rnnoise/src/_kiss_fft_guts.h +182 -0
- package/native/gxns/third_party/rnnoise/src/arch.h +261 -0
- package/native/gxns/third_party/rnnoise/src/celt_lpc.c +172 -0
- package/native/gxns/third_party/rnnoise/src/celt_lpc.h +45 -0
- package/native/gxns/third_party/rnnoise/src/common.h +48 -0
- package/native/gxns/third_party/rnnoise/src/denoise.c +664 -0
- package/native/gxns/third_party/rnnoise/src/kiss_fft.c +601 -0
- package/native/gxns/third_party/rnnoise/src/kiss_fft.h +203 -0
- package/native/gxns/third_party/rnnoise/src/opus_types.h +159 -0
- package/native/gxns/third_party/rnnoise/src/pitch.c +523 -0
- package/native/gxns/third_party/rnnoise/src/pitch.h +149 -0
- package/native/gxns/third_party/rnnoise/src/rnn.c +178 -0
- package/native/gxns/third_party/rnnoise/src/rnn.h +65 -0
- package/native/gxns/third_party/rnnoise/src/rnn_data.c +11051 -0
- package/native/gxns/third_party/rnnoise/src/rnn_data.h +34 -0
- package/native/gxns/third_party/rnnoise/src/tansig_table.h +45 -0
- package/native/gxns/third_party/speexdsp/AUTHORS +18 -0
- package/native/gxns/third_party/speexdsp/COPYING +35 -0
- package/native/gxns/third_party/speexdsp/arch.h +232 -0
- package/native/gxns/third_party/speexdsp/resample.c +1239 -0
- package/native/gxns/third_party/speexdsp/resample_neon.h +339 -0
- package/native/gxns/third_party/speexdsp/resample_sse.h +128 -0
- package/native/gxns/third_party/speexdsp/speex_resampler.h +343 -0
- package/package.json +186 -4
- package/src/android/bindings.ts +61 -0
- package/src/android/index.ts +10 -0
- package/src/android/micMute.ts +422 -0
- package/src/android/nativeAudio.ts +94 -0
- package/src/android/noiseSuppression.ts +209 -0
- package/src/android/roomMusic.ts +193 -0
- package/src/android/singerMode.ts +53 -0
- package/src/android/voiceEffects.ts +126 -0
- package/src/audio/AudioManager.ts +111 -0
- package/src/audio/AudioSession.ts +190 -0
- package/src/audio/remoteVolume.ts +58 -0
- package/src/components/VideoView.tsx +152 -0
- package/src/features/audioScenario.ts +58 -0
- package/src/features/beauty.ts +1057 -0
- package/src/features/micRelease.ts +108 -0
- package/src/features/noiseSuppression.ts +251 -0
- package/src/features/roomMusic.ts +106 -0
- package/src/features/roomMusicAndroid.ts +310 -0
- package/src/features/roomMusicIos.ts +300 -0
- package/src/features/roomMusicTypes.ts +97 -0
- package/src/features/screenShare.ts +19 -0
- package/src/features/singerMode.ts +70 -0
- package/src/features/voiceEffects.ts +245 -0
- package/src/hooks/context.tsx +38 -0
- package/src/hooks/hooks.ts +247 -0
- package/src/hooks/types.ts +10 -0
- package/src/hooks/useRoomEvents.ts +35 -0
- package/src/index.tsx +134 -0
- package/src/ios/autoAttach.ts +11 -0
- package/src/ios/iosAudio.ts +202 -0
- package/src/join/appStateLifecycle.ts +55 -0
- package/src/micPolicy.ts +312 -0
- package/src/native/NativeGravixAudio.ts +30 -0
- package/src/native/NativeGravixRtc.ts +38 -0
- package/src/native/module.ts +22 -0
- package/src/polyfills/DOMException.ts +20 -0
- package/src/polyfills/early.ts +16 -0
- package/src/polyfills/event.ts +88 -0
- package/src/polyfills/sha256.ts +112 -0
- package/src/polyfills/subtleHmac.ts +124 -0
- package/src/polyfills/textCoding.ts +197 -0
- package/src/registerGlobals.ts +201 -0
- package/src/unsupported.ts +139 -0
- package/src/version.ts +4 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Feature matrix: Flutter gravix_rtc 0.12.2 → gravix-rtc-react-native 0.2.0
|
|
2
|
+
|
|
3
|
+
Reference: Flutter `gravix_rtc` 0.12.2 = `Flutter_dart/gravix_cloud` commit
|
|
4
|
+
`5c4d44c` (public API = `lib/gravix_rtc.dart` exports). Android native SDK
|
|
5
|
+
compared: `Android_native/gravix-rtc-android` main `7133af8c` (0.3.2).
|
|
6
|
+
|
|
7
|
+
Status:
|
|
8
|
+
- **done (core)**: provided by the `gravix-rtc` JS core (0.10.0), re-exported here;
|
|
9
|
+
works in React Native once `registerGlobals()` ran. Not yet exercised on a device.
|
|
10
|
+
- **done (RN)**: implemented in this package (JS and/or the `GravixRtc` native module).
|
|
11
|
+
- **partial**: part of it works; the note says which part is missing.
|
|
12
|
+
- **stub**: typed API in place, throws `GravixUnsupportedError` until the native
|
|
13
|
+
part lands (gated by `getCapabilities().features.<feature>`).
|
|
14
|
+
- **external**: provided by another Gravix package.
|
|
15
|
+
- **n/a**: not applicable to React Native, or not planned for 0.1.
|
|
16
|
+
|
|
17
|
+
Path abbreviations: `F:` = Flutter repo (`lib/` = `lib/src/`), `K/` =
|
|
18
|
+
`F:android/src/main/kotlin/com/gravitycompile/gravix_cloud/`, `S/` =
|
|
19
|
+
`F:ios/gravix_rtc/Sources/gravix_rtc/`, `A/` =
|
|
20
|
+
`gravix-rtc-android/gravix-rtc-android-sdk/src/main/java/com/gravixcloud/rtc/`.
|
|
21
|
+
RN paths are in this repo.
|
|
22
|
+
|
|
23
|
+
## Connect, join, tokens
|
|
24
|
+
|
|
25
|
+
| # | Flutter feature (API) | RN status | RN API / notes | Port sources (Flutter native; Android SDK) |
|
|
26
|
+
|---|---|---|---|---|
|
|
27
|
+
| 1 | Room service controller (`GravixRoomService`) | partial | No single controller class: `Room` (core) + hooks (`useRoom`, `useParticipant`) + `AudioSession`. A `GravixRoomService`-shaped wrapper is a follow-up. | F:lib/room/gravix_room_service.dart; A/service/GravixRoomService.kt |
|
|
28
|
+
| 2 | Connect / disconnect / leaveNow / dispose | done (core) | `room.connect(url, token)`, `room.disconnect()` | F:lib/rtc_core/src/core/room.dart |
|
|
29
|
+
| 3 | Token provider (literal / callback / endpoint), `connectWithTokenProvider` | done (core) | `GravixTokenProvider.*`, `connectWithTokenProvider` | F:lib/backend/gravix_token_provider.dart |
|
|
30
|
+
| 4 | Local token minting (`GravixTokenBuilder`, `GravixTokenProvider.local`) | done (core + RN) | `createToken`, `GravixTokenProvider.local`; RN adds an HMAC-SHA256 `crypto.subtle` (Hermes has no WebCrypto) — `src/polyfills/subtleHmac.ts`, tested against node crypto | F:lib/backend/gravix_token_builder.dart; A/token/GravixTokenBuilder.kt |
|
|
31
|
+
| 5 | Legacy backend client (`GravixCloudBackend`, deprecated) | done (core) | `GravixCloudBackend` | F:lib/backend/gravix_cloud_backend.dart |
|
|
32
|
+
| 6 | `GravixJoin` / join url / join events / hooks / log | done (core + RN) | `createGravixJoin(opts)` = `GravixJoin` with `gravixAppStateLifecycle()` (AppState) as the join guard — `src/join/appStateLifecycle.ts` | F:lib/join/*.dart; A/join/GravixJoin.kt |
|
|
33
|
+
| 7 | Prejoin (`GravixPrejoin`) | done (core) | `GravixPrejoin` | F:lib/join/gravix_prejoin.dart; A/join/GravixPrejoin.kt |
|
|
34
|
+
| 8 | Rejoin policy / room refused | done (core) | `GravixRejoinPolicy` | F:lib/join/gravix_rejoin_policy.dart |
|
|
35
|
+
| 9 | Fast join / viewer fast start / restart strategy | done (core) | core fast connect + `warmUpWebRTC`; Flutter's `GravixFastConnectChannel.kt` native helper has no RN port (not needed so far) | F:lib/connect/gravix_fast_join.dart; K/GravixFastConnectChannel.kt |
|
|
36
|
+
| 10 | Join phases / timeline / timing logs | done (core) | `joinTimeline`, `RoomEvent.JoinTimeline`, `[GravixJoin]` lines | F:lib/connect/gravix_join_timeline*.dart |
|
|
37
|
+
| 11 | Region probe client / prober / sampler | done (core) | `connectOptions.regionProbe`; JS has no isolate (runs on the JS thread) | F:lib/connect/gravix_region_prober.dart; A/regions/* |
|
|
38
|
+
| 12–16 | Region selection, cache / init measure, shortlist, failover / join wait, region media toggles | done (core) | core region modules; cache uses `localStorage` when present, else in-memory (no persistent region cache across app starts in RN — follow-up: AsyncStorage adapter). `startRegionMeasurement()`: pass `networkEvents` (e.g. from NetInfo); without it the `window` fallback gets inert listeners from `registerGlobals()` (no online/offline re-measure) | F:lib/connect/gravix_region_*.dart; A/regions/* |
|
|
39
|
+
| 17 | Region / connection / first-audio reports | done (core) | `RoomEvent.RegionReport`, connection report | F:lib/connect/gravix_region_report.dart, gravix_connection_report.dart |
|
|
40
|
+
| 18 | Standby (second signal socket, low-RTT upgrade) | done (core) | `room.standby`, `GravixStandbyState` | F:lib/connect/gravix_standby.dart |
|
|
41
|
+
| 19 | Prewarm | done (core) | `prewarmJoin`, `room.prewarm` | F:lib/connect/gravix_prewarm.dart |
|
|
42
|
+
| 20 | Signal isolate | n/a | JS is single-threaded; the socket runs on the JS thread | F:lib/connect/gravix_signal_isolate.dart |
|
|
43
|
+
| 21 | Analytics / join report | done (core) | core analytics join report | F:lib/connect/gravix_analytics.dart |
|
|
44
|
+
| 22 | Reconnect policy / timing / recovery options | partial | core reconnect logic works; browser `online`/`offline` events do not exist in RN, so network-change triggers rely on ICE (follow-up: NetInfo bridge) | F:lib/rtc_core/src/gravix_recovery_options.dart; A/room/network/* |
|
|
45
|
+
|
|
46
|
+
## Media, participants, quality
|
|
47
|
+
|
|
48
|
+
| # | Flutter feature (API) | RN status | RN API / notes | Port sources |
|
|
49
|
+
|---|---|---|---|---|
|
|
50
|
+
| 23a | Mic publish / mute (`setMicEnabled`, `muteLocalAudio`) | done (core) | `localParticipant.setMicrophoneEnabled` | F:lib/rtc_core/src/track/local/audio.dart |
|
|
51
|
+
| 23b | **Mute releases mic** (0.12.1/0.12.2, `muteReleasesMic`, music keeps playing under mute) | **done (RN), on by default** — Android; iOS only with the opt-in `GravixAudioDevice` = YES (beta), otherwise a plain mute with the mic open | Every Room, automatically (`registerGlobals()` taps `Room.prototype.emit`, `src/micPolicy.ts`); rollback: `registerGlobals({ muteReleasesMic: false })` or `GravixMicRelease.setMuteReleasesMic(false)`. iOS: each published mic gets `stopOnMute`, a mic published muted is stopped. Android: a plain mute stops WebRTC's recorder; a mic published (or republished on reconnect) while muted gets its recorder closed (`closeMutedCapture`, Flutter `recorderNativeState` loop); voice-only mute under music via `GravixRoomMusic.setMicMuted` (no mute signal, song keeps going out, recorder released); a core mute during it hands the mute to the core; leave releases the engine mute. UI: `useMicMuted()` / `GravixMicRelease.isMicMuted(room)` (true also for the voice-only mute, where `track.isMuted` stays false). Device check pending. | K/music/MusicMicRelease.kt, GravixClientPlugin.recorderNativeState; F:lib/rtc_core/src/track/local/music_voice_mute.dart, engine_mic_mute.dart, mic_republish.dart |
|
|
52
|
+
| 24 | Camera publish / mute | done (core) | `localParticipant.setCameraEnabled`, `VideoView` | F:lib/rtc_core/src/track/local/video.dart |
|
|
53
|
+
| 25 | Camera switch + facing sync | done (core) | `localVideoTrack.restartTrack({ facingMode })`; `facingModeFromLocalTrack` | F:lib/rtc_core/src/track/local/video.dart |
|
|
54
|
+
| 26 | Remote mute / participants / user callbacks | done (core + RN) | `RemoteAudioTrack.setVolume`, participant events; hooks `useParticipants`, `useRemoteParticipants`, `useParticipant` | F:lib/rtc_core/src/participant/*.dart |
|
|
55
|
+
| 27 | Active speakers | done (core + RN) | `useActiveSpeakers`, `RoomEvent.ActiveSpeakersChanged` | F:lib/rtc_core/src/events.dart |
|
|
56
|
+
| 28 | Request high quality / effective quality / video stats | done (core) | core effective quality; adaptive stream gets view size/visibility from `VideoView` | F:lib/room/gravix_effective_quality.dart |
|
|
57
|
+
| 29 | Data saver | done (core) | `GravixDataSaver` | F:lib/room/gravix_data_saver.dart |
|
|
58
|
+
| 30 | Audio-first | done (core) | `GravixAudioFirst` | F:lib/room/gravix_audio_first.dart |
|
|
59
|
+
| 31 | RED mode | done (core) | `GRAVIX_RED_MODES`, publish option | F:lib/room/gravix_red_mode.dart |
|
|
60
|
+
| 32 | Large room (room view, publish presets, audio-only fallback, attributes) | done (core) | `partitionRoomView`, `GravixAudioOnlyFallback`, `GravixAttribute`; the React hooks of `gravix-rtc/react` are web-only, RN apps use these helpers directly | F:lib/large_room/*.dart |
|
|
61
|
+
| 58 | Connection check | done (core) | `ConnectionCheck` | F:lib/rtc_core/src/connection_check/** |
|
|
62
|
+
| 59 | Data channel / data streams / RPC | done (core) | `publishData`, streams (web-streams polyfill), RPC | F:lib/rtc_core/src/data_stream/*, rpc/* |
|
|
63
|
+
| 60 | E2EE | n/a (0.1) | needs `RNE2EEManager`-style frame cryptor bridge + real WebCrypto; not ported | F:lib/rtc_core/src/e2ee/* |
|
|
64
|
+
| 61 | Stats / uplink watch / media watchdog | done (core) | core stats | F:lib/rtc_core/src/stats/* |
|
|
65
|
+
| 62 | ICE transport / simulcast / publish runners | done (core) | react-native-webrtc's own codec factories (2026-12-01; no simulcast wrapper for hardware encoders, VP8 simulcast in libvpx) | A/webrtc/SimulcastVideoEncoderFactoryWrapper.kt |
|
|
66
|
+
| 63 | Agent / session / transcription | done (core) | core agent surface | F:lib/rtc_core/src/agent/** |
|
|
67
|
+
| 64 | Certificate pinning | n/a | platform TLS | F:lib/rtc_core/src/support/certificate_pinning.dart |
|
|
68
|
+
| 65 | Web client entry | n/a | | |
|
|
69
|
+
|
|
70
|
+
## Audio session and routing
|
|
71
|
+
|
|
72
|
+
| # | Flutter feature (API) | RN status | RN API / notes | Port sources |
|
|
73
|
+
|---|---|---|---|---|
|
|
74
|
+
| 33 | **Audio scenario** (`GravixAudioScenario.chatRoom`) | **Android: done** / iOS: done (no-op) | `gravixUseAudioScenario('chatRoom')` — Android: latched natively, `GravixRtc.setup(context, audioScenario = "chatRoom")`, the JS call checks it. iOS: recorded; turns our NS AGC off (Flutter iOS ignores the scenario). | F:lib/rtc_core/src/audio/gravix_audio_scenario.dart; K/rtc/GxMediaEchoTuning.kt |
|
|
75
|
+
| 34 | Audio routing v1 (speaker / earpiece / BT / wired) | done (RN) | `AudioSession.configureAudio`, `getAudioOutputs`, `selectAudioOutput`, `setSpeakerphoneOn`, `showAudioRoutePicker`; Android AudioSwitch, iOS AVAudioSession. No route-change event yet. | K/rtc/GxAudioSwitchManager.kt, RouteChangeTracker.kt; S/rtc/AppleAudioOutput.swift |
|
|
76
|
+
| 35 | Audio routing v2 (`GravixAudioRouting.v2`) | n/a (0.1) | v1 semantics only | K/rtc/AudioRoutePolicy.kt; F:lib/audio/gravix_audio_routing.dart |
|
|
77
|
+
| 36 | Early call audio / foreign call detector | n/a (0.1) | | K/rtc/GxOtherAppAudioMonitor.kt; F:lib/audio/gravix_foreign_call_detector.dart |
|
|
78
|
+
| 37 | Other-app audio policy | n/a (0.1) | needs capture switch (pipeline hook) | K/rtc/GxCaptureSwitcher.kt, OtherAppAudioPolicy.kt |
|
|
79
|
+
| 38 | Background guard / keep-alive player | n/a (0.1) | iOS: `UIBackgroundModes audio`; Android: app foreground service | K/rtc/GxKeepAlivePlayer.kt |
|
|
80
|
+
| 39 | Media-profile echo tuning | n/a (0.1) | part of audio scenario work | K/rtc/GxMediaEchoTuning.kt |
|
|
81
|
+
| 40 | Call / foreground service (Android) | n/a (0.1) | app-owned for now | K/rtc/GravixCallService.kt; A/service/GravixCallService.kt |
|
|
82
|
+
| 41 | **Screen share** (MediaProjection / broadcast extension) | **stub** | `GravixScreenShare.start/stop` — feature `screenShareService`. rn-webrtc has the capture parts; Gravix service/extension wiring missing | K/rtc/ScreenCaptureService.kt; F:ios/BroadcastExtension/*, S/rtc/BroadcastManager.swift; A/room/track/screencapture/* |
|
|
83
|
+
|
|
84
|
+
## Native audio features (need a WebRTC audio-pipeline hook)
|
|
85
|
+
|
|
86
|
+
| # | Flutter feature (API) | RN status | RN API | Port sources |
|
|
87
|
+
|---|---|---|---|---|
|
|
88
|
+
| 42 | **Noise suppression** (off / standard / studio / auto; RNNoise, DFN3, AGC order, HW / headset NS, studio pack) | **Android: partial** / **iOS: done** | `GravixNoiseSuppression.instance.setMode(mode, options)` / `getState()`; gravix-rtc mode/option types. Both platforms run the shared `native/gxns` core. Android studio DFN3 (arm64) is **opt-in**: `gravixNsStudio=true` in gradle.properties fetches the ~6 MB binaries at build time (pinned SHA-256; `gravixNsStudioDir` or `gravixNsStudioUrl`), default off (studio reports `studio_unavailable`, RNNoise runs). iOS studio = Core ML DFN3 (bundled 2.6 MB). Partial (Android): WebRTC NS / AGC are not switched off for the app. Publish the mic with `noiseSuppression: false, autoGainControl: false` while ours runs (iOS: `webrtcProcessingFor(engine)`). | K/rtc/GxNoiseProcessor.kt, GxNsStudio.kt; native/gxns; S/noise/GxNoiseProcessor.swift |
|
|
89
|
+
| 43 | NS policy / report log (`[GravixNS]`) | done (core) | core `noise/policy`, `noise/log` (types + resolver) | F:lib/noise/gravix_noise_policy.dart, gravix_noise_report.dart |
|
|
90
|
+
| 44 | **Voice effects** (35 + none) | **Android: done** / **iOS: done** | `GravixVoiceEffects.instance.set(effect)` / `refresh()` / `benchmark(effect, seconds = 5)`; 36 names, Flutter order; shared `native/gxfx` core | K/rtc/GxVoiceFx.kt; native/gxfx; F:lib/voice_fx/gravix_voice_effects.dart |
|
|
91
|
+
| 45 | **Singer mode** — publish half (processing off, DTX off, 96 kbps) | done (core) | `room.setSingerMode(on, options)` | F:lib/room/gravix_singer_mode.dart |
|
|
92
|
+
| 45b | **Singer mode** — capture source switch + level normaliser | **Android: partial** / iOS: partial | `GravixSingerCapture.setCaptureSource(src)`, `setLevelNormaliser(on)`. Android: recorder source switch + normaliser. iOS: a source other than `keep` bypasses the Gravix chain (Flutter iOS); the normaliser rejects. Pair with the core `room.setSingerMode` for processing / DTX / bitrate. | K/rtc/GxSingerSource.kt; gxns C (normaliser) |
|
|
93
|
+
| 46 | **Room music** (file mixed into the mic: start / stop / pause / resume / seek) | **Android: partial** / **iOS: done** | `new GravixRoomMusic(options)` (platform dispatch: `roomMusicAndroid.ts` / `roomMusicIos.ts`), `GravixMusicSource.file/contentUri/asset`. Android: `asset` not yet (use `file`); `musicMaxBitrate` / `disableDtxWhileMusic` are NOT applied (the song goes out at the voice bitrate unless the app calls `room.setSingerMode(true, …)`). iOS: file paths only, post-effect mix only; `musicMaxBitrate` / `disableDtxWhileMusic` go through `room.setSingerMode(true, …)` while the song plays (needs `attach(room)`; an app-owned singer mode is left alone) and are undone on stop. Not ported: Flutter's state / position / completed / error streams, `stopForLeave`, `isSupported` (read `state`, poll `positionNow()`). | K/music/MusicMixerEngine.kt …; S/music/*; F:lib/music/gravix_room_music.dart |
|
|
94
|
+
| 47 | Music volume / mic volume / ducking / prepare / loop | **Android: done** / **iOS: done** | `setMusicVolume`, `setMicVolume`, `setDucking`, `setLoop`, `prepare` (Android/iOS: `prepare` only checks the source) | K/music/MusicMixKernel.kt; S/music/GxMusicPost.swift |
|
|
95
|
+
| 48 | Music post-effect mix | **Android: done** / **iOS: done** | `GravixMusicOptions.postEffectMix` (iOS: the only route) | K/music/MusicCaptureRouter.kt; native gx_music_post.c |
|
|
96
|
+
| 49 | Music under mute (song keeps playing while mute released the mic) | **Android: done (RN)** / iOS: n/a | `GravixRoomMusic.setMicMuted(true)`: voice-only mute (+ recorder release with `continueWhileMicReleased`), see 23b. iOS has no voice-only mute (as Flutter): the song stops for listeners under a mute. `start` on a muted mic is refused on Android. | K/music/MusicMicRelease.kt |
|
|
97
|
+
| 50 | Karaoke singer position | **Android: partial** / **iOS: done** | `positionNow()`. Android: a JS wall clock from start/seek (does not read the native `positionMs` / `positionAgeUs`; drifts, and pins at the duration when looping). iOS: native position + age. | K/music/MusicMixerEngine.kt; F:lib/music/gravix_room_music.dart |
|
|
98
|
+
| 51 | Listener lyric sync (`gx.music`) | stub | `remotePositionNow(identity)`, `GRAVIX_MUSIC_SYNC_TOPIC`; pure logic, port with #46 | F:lib/music/gravix_music_sync.dart |
|
|
99
|
+
| 52 | Music interruption handling | **Android: done** / iOS: stub | part of `roomMusic`; Android: call mode + audio focus | K/music/MusicInterruptionWatcher.kt |
|
|
100
|
+
| 52b | `GravixMusicController` (Flutter's older, path-based music API) | n/a (0.1) | Use `GravixRoomMusic`; same native mixer. | F:lib/music/gravix_music_controller.dart |
|
|
101
|
+
| 55 | Audio frame capture / FFT visualizer | n/a (0.1) | volume processors could be ported from an Apache-2.0 upstream | K/rtc/FFTAudioAnalyzer.kt, Visualizer.kt; S/rtc/FFTProcessor.swift |
|
|
102
|
+
| 56 | Audio processor hook (`TrackProcessor`) | n/a (0.1) | the hook the native features above will use (see below) | K/rtc/AudioProcessors.kt; S/rtc/AudioProcessing.swift; A/audio/AudioProcessingController.kt |
|
|
103
|
+
| 57 | Preconnect audio buffer | n/a (0.1) | | F:lib/rtc_core/src/preconnect/pre_connect_audio_buffer.dart; A/audio/PreconnectAudioBuffer.kt |
|
|
104
|
+
| 66 | Capture dump (debug) | n/a | | K/rtc/GxCaptureDump.kt |
|
|
105
|
+
|
|
106
|
+
## Video effects
|
|
107
|
+
|
|
108
|
+
| # | Flutter feature | RN status | Notes |
|
|
109
|
+
|---|---|---|---|
|
|
110
|
+
| 53 | Beauty / video effect hook (`GravixVideoEffect`, `GravixCameraEffect`, `GravixBeautyEffect`, `setVideoEffectEnabled/Params`, `videoEffectActive`, `switchCamera`, `setCameraEnabled`, join with the camera) | **Android: done** / iOS: n/a (normal camera) | `GravixRoomCamera(room, { videoEffect: new GravixBeautyEffect() })`, `camera.connect(url, token)`; wiring over the optional peers `react-native-gravix-effects(-webrtc)` 1.4.3 (lazy, absent = normal camera). Differences from Flutter 0.12.2: params merged for the replay (rollback `mergeEffectParams: false`); the effect camera opens during the connect (Flutter: after; rollback `openCameraDuringConnect: false`); replay adds the LUT (`lut` / `lutBytes`); `switchCamera` rejects on errors (Flutter logs); no camera-facing publish; a failed republish closes the camera like Flutter. Sources: `src/features/beauty.ts`; F:lib/src/beauty/*.dart + room service camera part. |
|
|
111
|
+
| 54 | Effects pack (download on first use), preload, licence | **Android: done** | `GravixBeautyEffect.availability()` / `ensurePack(onProgress)` / `preload()` / `licenseStatus()`; the rest of the effects API on `beauty.camera` or via `gravixEffects()`. |
|
|
112
|
+
|
|
113
|
+
## Capability flags (stubs where the platform lacks them)
|
|
114
|
+
|
|
115
|
+
Each feature below is one capability flag. Flip it to `true` in
|
|
116
|
+
`android/.../GravixRtcModule.kt` `getCapabilities()` / `ios/GravixRtc.mm`
|
|
117
|
+
`GravixNativeFeatures()` handling when the platform implements it, add the
|
|
118
|
+
native methods to `src/native/NativeGravixRtc.ts` (the TurboModule spec), and
|
|
119
|
+
replace the `unsupported*()` bodies in the listed JS file with calls to them.
|
|
120
|
+
`src/__tests__/unsupported.test.ts` lists every stub call; update it.
|
|
121
|
+
|
|
122
|
+
| Feature flag | JS API file | Operations |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| `voiceEffects` | `src/features/voiceEffects.ts` | set, refresh, benchmark |
|
|
125
|
+
| `roomMusic` | `src/features/roomMusic.ts` | attach, prepare, start, pause, resume, stop, seek, setMusicVolume, setMicVolume, setDucking, setLoop, setMicMuted, positionNow, remotePositionNow |
|
|
126
|
+
| `muteReleasesMic` | `src/features/micRelease.ts` | setMuteReleasesMic |
|
|
127
|
+
| `noiseSuppression` | `src/features/noiseSuppression.ts` | setMode, getState |
|
|
128
|
+
| `singerMode` | `src/features/singerMode.ts` | setCaptureSource, setLevelNormaliser |
|
|
129
|
+
| `audioScenario` | `src/features/audioScenario.ts` | use |
|
|
130
|
+
| `screenShareService` | `src/features/screenShare.ts` | start, stop |
|
|
131
|
+
|
|
132
|
+
Both platform branches are merged. Every flag except `screenShareService`
|
|
133
|
+
is on when the native audio is set up (Android `GravixRtc.setup`, iOS
|
|
134
|
+
`GravixRtcSetup.setup()`); then only that flag stays a stub. Android: "done" =
|
|
135
|
+
implemented, built and unit tested, NOT device-verified yet. Every flag above except
|
|
136
|
+
`screenShareService` is on once `GravixRtc.setup` built the audio device
|
|
137
|
+
module. The calls go through a second, Android-only TurboModule `GravixAudio`
|
|
138
|
+
(`src/native/NativeGravixAudio.ts`: one generic `call(method, args)` with the
|
|
139
|
+
Flutter channel method names + the `GravixAudioEvent` device event), so the
|
|
140
|
+
shared `GravixRtc` spec and iOS are untouched. Details and the remaining gaps:
|
|
141
|
+
`docs/ANDROID_NATIVE_HOOKS.md`.
|
|
142
|
+
|
|
143
|
+
### Where the native hooks attach in React Native
|
|
144
|
+
|
|
145
|
+
Flutter reaches into a patched `flutter_webrtc` (APM capture post-processing
|
|
146
|
+
slot, pre-APM `AudioBufferCallback`, recorder access). Since 2026-12-01 the
|
|
147
|
+
React Native WebRTC engine is `react-native-webrtc` ^155 (WebRTC builds
|
|
148
|
+
`org.jitsi:webrtc` 155.0.1 / `JitsiWebRTC` 155), a stock libwebrtc without
|
|
149
|
+
those hooks:
|
|
150
|
+
|
|
151
|
+
- Android: `WebRTCModuleOptions.audioDeviceModule` (built by `GravixRtc.setup`)
|
|
152
|
+
is the only audio seam. Its record-state callback attaches the Gravix
|
|
153
|
+
capture seam (`GxRecorderSeam`, an AudioRecord swapped in at each recording
|
|
154
|
+
start) that runs the music mix, the capture chain (NS -> voice FX ->
|
|
155
|
+
post-effect music), the recorder release and the capture source switch,
|
|
156
|
+
BEFORE WebRTC's audio processing. Details: `docs/ANDROID_NATIVE_HOOKS.md`.
|
|
157
|
+
- iOS: only `WebRTCModuleOptions.audioDevice` (a complete `RTCAudioDevice`).
|
|
158
|
+
Gravix has none yet, so the capture-chain features report unavailable;
|
|
159
|
+
see `docs/IOS_NATIVE_HOOKS.md`.
|
|
160
|
+
|
|
161
|
+
Standalone (no pipeline hook): routing (done), call/foreground service, screen
|
|
162
|
+
share service/extension, keep-alive player, interruption watcher.
|
|
163
|
+
|
|
164
|
+
## iOS native status (merged from feat/ios-native)
|
|
165
|
+
|
|
166
|
+
**2026-12-01: on react-native-webrtc 155 the iOS capture-chain features below
|
|
167
|
+
(voice effects, noise suppression, room music, singer mode, mute releases mic)
|
|
168
|
+
run in the Gravix `RTCAudioDevice` (`GxAudioDevice`), which is OPT-IN (beta):
|
|
169
|
+
Info.plist `GravixAudioDevice` = YES. Without it (the default) they report
|
|
170
|
+
unavailable and a mute is a plain track mute. Not yet verified on an iPhone;
|
|
171
|
+
see IOS_NATIVE_HOOKS.md section 8b.**
|
|
172
|
+
|
|
173
|
+
Ported from Flutter gravix_rtc 0.12.2 (5c4d44c, `ios/gravix_rtc`). Hooks,
|
|
174
|
+
gaps and the patch-vs-fork note: [IOS_NATIVE_HOOKS.md](IOS_NATIVE_HOOKS.md).
|
|
175
|
+
Build-verified only (simulator build, host C tests, jest); every runtime
|
|
176
|
+
audio claim is on the device test list in that file. The capture-chain
|
|
177
|
+
features report `true` only when `GravixRtcSetup.setup()` installed the Gravix
|
|
178
|
+
audio processing module.
|
|
179
|
+
|
|
180
|
+
| # | Feature | iOS status | Notes |
|
|
181
|
+
|---|---|---|---|
|
|
182
|
+
| 23b | Mute releases mic | opt-in beta (`GravixAudioDevice` = YES); default: plain mute, mic open | As in Flutter iOS: no native code. The room hook sets `stopOnMute` on every published mic and stops a mic published muted (no app call; `GravixMicRelease.attach(room)` remains for a mic published before a setting change); `getRecorderState()` reads the WebRTC audio engine. Under such a mute the song stops for listeners too (no voice-only mute on iOS). |
|
|
183
|
+
| 33 | Audio scenario | done (no-op) | Flutter ignores the scenario on iOS; `chatRoom` only turns our NS AGC off. |
|
|
184
|
+
| 42 | Noise suppression | done | `gx_ns` (RNNoise) + DFN3 Core ML studio (bundled `gravix_rtc_ns` resource), resolved by gravix-rtc `resolveNs`; studio benchmark per process (no persistent cache). Publish the mic with `webrtcProcessingFor(engine)` so WebRTC's NS/AGC do not stack. LL studio pack download not wired. C core shared with Android in `native/`. |
|
|
185
|
+
| 44 | Voice effects | done | `gx_fx`, 36 presets, same native core and order as Flutter. |
|
|
186
|
+
| 45b | Singer mode (native half) | partial | `setCaptureSource(src != 'keep')` bypasses the Gravix chain (Flutter iOS); no recorder source switch on iOS; level normaliser is Android only (rejects). |
|
|
187
|
+
| 46–48 | Room music, volumes, ducking, post-effect mix | done | Music bitrate / DTX via `room.setSingerMode` while playing. Post-effect route only (`gx_music_post`); `postEffectMix: false` is refused. Sources: file paths; assets must be resolved to a file by the app. Host monitor needs the audio-engine graph hook (installed at SDK import). |
|
|
188
|
+
| 49 | Music under mute | n/a | iOS has no voice-only mute (Flutter proposal only). |
|
|
189
|
+
| 50 | Singer position | done | `positionNow()` from the native position + its age. |
|
|
190
|
+
| 51 | Listener lyric sync | stub | Cross-platform JS, not part of the iOS native port. |
|
|
191
|
+
| 52 | Music interruption | stub | Not ported. |
|
|
192
|
+
| 53 | Beauty | n/a | The effects packages are Android-only: `GravixBeautyEffect.isAvailable()` is false and `GravixRoomCamera` publishes the normal camera (same app code). |
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# iOS native hooks: Flutter gravix_rtc 0.12.2 -> gravix-rtc-react-native
|
|
2
|
+
|
|
3
|
+
Status 2026-12-01. Reference: Flutter `gravix_cloud` 5c4d44c (`ios/gravix_rtc`).
|
|
4
|
+
RN engine: `react-native-webrtc` 155 on `JitsiWebRTC` 155 (a stock WebRTC build,
|
|
5
|
+
`RTC` symbol prefix).
|
|
6
|
+
|
|
7
|
+
## 0. Current state (react-native-webrtc 155): the Gravix audio device
|
|
8
|
+
|
|
9
|
+
JitsiWebRTC 155 has no audio processing module slot (no
|
|
10
|
+
`capturePostProcessingDelegate`, no `RTCAudioBuffer`, no
|
|
11
|
+
`RTCDefaultAudioProcessingModule` class in the binary), no AVAudioEngine audio
|
|
12
|
+
device module and no ADM observer. `WebRTCModuleOptions` offers only
|
|
13
|
+
`audioDevice` (a complete `RTCAudioDevice`, read once in `-[WebRTCModule init]`
|
|
14
|
+
and passed to `-[RTCPeerConnectionFactory initWithEncoderFactory:decoderFactory:audioDevice:]`).
|
|
15
|
+
Checked against `WebRTC.framework/Headers` and the exported ObjC classes
|
|
16
|
+
(2026-12-01). So the capture features run inside a Gravix `RTCAudioDevice`:
|
|
17
|
+
|
|
18
|
+
- `ios/audio/GxAudioDevice.m` (installed by `GravixRtcSetup.setup()` through
|
|
19
|
+
`GxAudioSetup`, by class name, no react-native-webrtc patch): one VPIO unit
|
|
20
|
+
(Apple AEC / NS / AGC), 16-bit mono at the session rate. Each IO block (any
|
|
21
|
+
size up to 4096 frames, not 10 ms) runs `gx_ns -> gx_fx -> gx_music_post`
|
|
22
|
+
(`gx_pcm.c` int16 <-> float glue, `gx_ios_capture_process` in Swift), then
|
|
23
|
+
`deliverRecordedData`. Playout = `getPlayoutData` + the room-music monitor
|
|
24
|
+
(`gx_ios_monitor_read`), replacing the AVAudioEngine monitor node and the
|
|
25
|
+
ADM observer proxy (removed).
|
|
26
|
+
- **Order change** (as Android): the chain runs AFTER VPIO and BEFORE WebRTC's
|
|
27
|
+
software APM (was after it on 150.2). Publish the mic with
|
|
28
|
+
`webrtcProcessingFor(engine)` (WebRTC NS / AGC off) while ours runs.
|
|
29
|
+
- **Mute releases mic**: stock WebRTC keeps recording under a track stop
|
|
30
|
+
(`stop()` only disables the track), so the room mic policy calls
|
|
31
|
+
`setCaptureClosed` on every local mic mute / unmute (and closes a mic
|
|
32
|
+
published muted). That is the ONLY iOS mute path with the device (2026-12-01
|
|
33
|
+
review): the policy no longer also sets `stopOnMute` / stops the track (which
|
|
34
|
+
released nothing and made each unmute pay a getUserMedia + replaceTrack).
|
|
35
|
+
Rollback: Info.plist boolean `GravixMuteStopsMicTrack` = YES (exported as a
|
|
36
|
+
`GravixRtcIosAudio` constant; `GravixRoomMicPolicy.iosStopTrackOnMute` is an
|
|
37
|
+
internal / test override, not exported).
|
|
38
|
+
The close is a gate (`ios/audio/gx_adm_state.h`: OPEN / CLOSED /
|
|
39
|
+
CLOSED_UNTIL_STOP) that survives WebRTC's `stopRecording` / `startRecording`:
|
|
40
|
+
a muted mic republished after a full reconnect starts recording on the
|
|
41
|
+
playout-only unit, no input opens (it used to open until the JS re-closed it:
|
|
42
|
+
a mic-indicator flash). It ends with an unmute or a fresh unmuted publish
|
|
43
|
+
(immediate), or, when the muted publication ends for good (final unpublish
|
|
44
|
+
of a stopped track, room left, JS reload = module `invalidate`), with
|
|
45
|
+
`releaseCaptureClose`: closed while WebRTC still records, open once it stops.
|
|
46
|
+
An unpublish that keeps a live muted track (full reconnect, `disconnect(false)`
|
|
47
|
+
from a connect() during a reconnect, `unpublishTrack(t, false)`) does not
|
|
48
|
+
release: that track may be published again. Known limit: a mic whose FIRST
|
|
49
|
+
publish is already muted still opens the input until `localTrackPublished`
|
|
50
|
+
closes it (only republishes are fixed). A newer factory or `terminateDevice` resets it.
|
|
51
|
+
Closed, or while WebRTC records nothing, the unit is a
|
|
52
|
+
playout-only RemoteIO unit (no input, no mic indicator; a listener who never
|
|
53
|
+
publishes never opens the mic). `getRecorderState()` reads the device. Under
|
|
54
|
+
the close no capture reaches WebRTC: room music pauses for listeners and
|
|
55
|
+
holds its position (iOS has no voice-only mute, as before).
|
|
56
|
+
- **Audio session**: the device applies
|
|
57
|
+
`RTCAudioSessionConfiguration.webRTCConfiguration` and activates it while
|
|
58
|
+
playing / recording, deactivates when idle; honours `useManualAudio` /
|
|
59
|
+
`isAudioEnabled` (CallKit), restarts on interruption end, route rate changes
|
|
60
|
+
(re-notifies WebRTC of the new rate) and media-services resets.
|
|
61
|
+
- **Capability flags**: `voiceEffects`, `noiseSuppression`, `roomMusic`,
|
|
62
|
+
`singerMode` and `muteReleasesMic` are true only when the device is in the
|
|
63
|
+
options slot (installed by `setup()` before React Native starts). WebRTC
|
|
64
|
+
155 initialises the device lazily (first call / track), not when the
|
|
65
|
+
factory is built, so the flag cannot wait for that; `[GravixAudioDevice]
|
|
66
|
+
step=initialize` in the log confirms the factory took it. An app-set
|
|
67
|
+
`audioDevice` or no opt-in (the default): all false, and the mic policy does
|
|
68
|
+
nothing on iOS, so a mute is the core's plain track mute (mic stays open).
|
|
69
|
+
- **Factory takeover** (RN reload, a second RN host): `isInitialized` answers
|
|
70
|
+
per WebRTC thread, so a newer factory hands over its delegate and takes the
|
|
71
|
+
device; calls (and `terminateDevice`) from the older factory are no-ops. The
|
|
72
|
+
rule (comment in `ios/audio/gx_adm_state.h`, 2026-12-01 review): one
|
|
73
|
+
recursive control mutex around every lifecycle call and every block hopped to
|
|
74
|
+
the device thread, an atomic owner token + generation, owner re-checked after
|
|
75
|
+
taking the mutex. The takeover holds the mutex while it stops the old unit and
|
|
76
|
+
adopts the new delegate, so an older-factory call in progress (a unit start in
|
|
77
|
+
its init retries, a stop, a terminate) finishes first and every later one is
|
|
78
|
+
a no-op: no double unit dispose, no unit started against the new factory's
|
|
79
|
+
blocks, no terminate of the new factory. Queued blocks / retries carry the
|
|
80
|
+
generation and are dropped after a takeover or terminate. Never taken on the
|
|
81
|
+
IO threads (they read only atomics) nor by `setCaptureClosed` /
|
|
82
|
+
`recorderState`. Host-tested (`ios/tests/host/gx_adm_state_test.c`, plain +
|
|
83
|
+
ThreadSanitizer); not run on an iPhone.
|
|
84
|
+
- **Known limits** (review 2026-12-01): VPIO AGC is applied at each unit
|
|
85
|
+
build, so an NS change mid-call takes effect at the next mute / route
|
|
86
|
+
change; NS / FX watchdog budgets are per IO block (two 10 ms blocks at a
|
|
87
|
+
20 ms IO buffer), check for spurious demotion on a device; the studio NS
|
|
88
|
+
Core ML prediction runs on the IO thread (as in Flutter); each mute /
|
|
89
|
+
unmute switches VPIO <-> RemoteIO (expect a short playout gap).
|
|
90
|
+
- **Simulator**: on this Mac (iOS 27 simulator) every input unit start fails
|
|
91
|
+
with `AUIOClient_StartIO -66637`, also with WebRTC's own built-in device
|
|
92
|
+
(rollback run), so no IO callback could be observed there.
|
|
93
|
+
- **Opt-in (beta, 2026-12-01)**: the device is installed only with the
|
|
94
|
+
Info.plist boolean `GravixAudioDevice` = YES. Absent or NO (the default)
|
|
95
|
+
keeps WebRTC's built-in audio device (features false, a mute is a plain
|
|
96
|
+
track mute with the mic open). It stays opt-in until the section 8b iPhone list has passed.
|
|
97
|
+
- Verified SIMULATED only (simulator build + smoke run, jest, C host tests);
|
|
98
|
+
the iPhone list is in section 8b.
|
|
99
|
+
|
|
100
|
+
The sections below record the 150.2.x port that these sources implement.
|
|
101
|
+
|
|
102
|
+
## 1. What Flutter hooks, and the RN equivalent
|
|
103
|
+
|
|
104
|
+
| Flutter (flutter_webrtc fork + WebRTC-SDK 150.7871.01) | Used by | RN (react-native-webrtc 150.2.0, webrtc-sdk build) | Gap |
|
|
105
|
+
|---|---|---|---|
|
|
106
|
+
| `AudioManager.capturePostProcessingAdapter.addProcessing(_)`: the APM capture post-processing slot (`RTCDefaultAudioProcessingModule.capturePostProcessingDelegate`) | noise suppression, voice effects, post-effect music mix | `WebRTCModuleOptions.sharedInstance.audioProcessingModule` (read once in `-[WebRTCModule init]`). `GravixRtcSetup.setup()` calls `GxAudioSetup.installProcessing`, which sets `RTCDefaultAudioProcessingModule(config: nil, capturePostProcessingDelegate: GxNoiseProcessor.shared, renderPreProcessingDelegate: nil)` (the delegate property is weak; the processor is a process-lifetime singleton), which the app calls before React Native starts. | None. An app that sets its own `RTCDefaultAudioProcessingModule` keeps it; setup then only fills its `capturePostProcessingDelegate` when that is empty (the property can be changed at runtime). Any other APM: the audio features report unsupported. |
|
|
107
|
+
| `FlutterWebRTCPlugin.setAudioDeviceModuleObserver(_)`: owns the AVAudioEngine ADM delegate | music monitor node (`configureOutput`), VPIO AGC off (`configureInput`), engine create/release | No setter. `WebRTCModule` sets `adm.observer = AudioDeviceModuleObserver` (property is `weak`, settable). We place `GxAdmObserverProxy` in front: it implements the four graph callbacks (`didCreateEngine`, `willReleaseEngine`, `configureInput`, `configureOutput`), calls the WebRTC module's ADM observer first (Gravix first on `willReleaseEngine`, so its nodes are detached even if a JS handler times out) and returns the WebRTC module result, and forwards every other selector untouched (`forwardingTargetForSelector:` / `respondsToSelector:`), so the WebRTC module session policy and JS round trips keep working. The instance comes from `moduleRegistry moduleForName:"WebRTCModule"` (the module is exported unnamed). The proxy holds the WebRTC module's ADM observer strongly and is itself held by a static, and `respondsToSelector:` mirrors the WebRTC module's ADM observer, so the optional `willEnableEngine` variant it implements is the one called. | Small: installed when the SDK is imported (`src/ios/autoAttach.ts`). If the audio engine was configured before that, the monitor node waits for the next engine configure (next publish / route change). Patch alternative (see 3). |
|
|
108
|
+
| `RTCAudioSession` / `RTCAudioSessionConfiguration` | audio session | `RTCAudioSession`, `RTCAudioSessionConfiguration`, `automaticAudioSessionConfig` on the WebRTC module's ADM observer; core module `configureAudio` / `setAppleAudioConfiguration` | None (core agent's module). |
|
|
109
|
+
| `adm.setMuteMode`, `adm.stopRecording`, `isRecording` | mute closes mic (0.12.1) | Exported by RN webrtc (`audioDeviceModuleSetMuteMode`, `...StopRecording`, `...IsRecording`) | None. On iOS the 0.12.1 mute is `stopAudioCaptureOnMute` (the track stops, WebRTC stops the ADM recording, the mic indicator goes off): JS wiring. Flutter's iOS mute is the same (track disable + stop, no `setMuteMode`/`stopRecording`: `stopLocalRecording` stops the whole engine and is never used on iOS). JS: `stopOnMute` on the mic track (`GravixMicRelease.attach`) or `stopMicTrackOnMute: true` (default false in gravix-rtc). `getRecorderState()` checks the result; the OS indicator going off is unverified (device test). |
|
|
110
|
+
|
|
111
|
+
## 2. Feature feasibility (in porting order)
|
|
112
|
+
|
|
113
|
+
1. **Voice effects** (`gx_fx`, 36 presets): APM slot only. Port as is.
|
|
114
|
+
2. **Noise suppression levels** (`gx_ns`: off / standard RNNoise / studio DFN3 Core ML / auto): APM slot + engine `configureInput` (VPIO AGC off). Resolver comes from the `gravix-rtc` JS core (`resolveNs`, `iosChipFromModel`); native gives `nsDeviceFacts`, `nsConfigure`, `nsBenchmark`, `nsGetState`, events.
|
|
115
|
+
3. **Karaoke music, post-effect route** (`gx_music_post`: music after NS + effect, mic volume, ducking, delay alignment). NS and the voice effect stay ON during a song (the post route never bypasses them; only the 0.11 input-mixer route did). Singer mode is separate: `nsSetSingerMode` bypasses the NS chain (`GravixSingerCapture.setCaptureSource(src)`, any source but `keep` = bypass on, iOS has no recorder source switch): APM slot for the mix; ADM proxy for the host monitor node. Without the proxy the song still reaches listeners; only the host's own monitor is missing.
|
|
116
|
+
4. **Mute releases mic**: JS (`stopMicTrackOnMute`) + `getRecorderState()`.
|
|
117
|
+
5. **Audio scenario `chatRoom`**: Flutter ignores the scenario on iOS (Android only). On iOS the only effect is the NS AGC order `none`. Nothing native.
|
|
118
|
+
6. **Not ported**: `postMix: false` (0.11 input-mixer rollback route, answers `UNSUPPORTED`); iOS voice-only mute (proposal only in Flutter); beauty (Android-only effects packages, another session owns it: optional peer-dependency hook via RN webrtc `videoEffects` processors, documented only).
|
|
119
|
+
|
|
120
|
+
## 3. Patch vs. fork
|
|
121
|
+
|
|
122
|
+
No fork is needed for this scope. The one weak point is the ADM delegate (no chaining API). Options if the proxy proves fragile on a device:
|
|
123
|
+
- **(a) patch-package on `WebRTCModule.m`** (about 10 lines): an `WebRTCModuleOptions.audioDeviceModuleDelegate` that the WebRTC module's ADM observer forwards graph callbacks to. Upstreamable.
|
|
124
|
+
- **(b) Gravix fork of react-native-webrtc**: only if later features need ADM internals (for example the iOS voice-only mute option (b), a custom `RTCAudioDevice`). Not recommended now.
|
|
125
|
+
|
|
126
|
+
## 4. Native module shape
|
|
127
|
+
|
|
128
|
+
To stay out of the shared codegen spec (new spec methods become abstract on Android), the iOS audio features live in a separate interop module `GravixRtcIosAudio` (`RCTEventEmitter`, no codegen), reached only from the iOS branches of the stubs. Fold it into the `GravixRtc` TurboModule once both platforms implement the same methods.
|
|
129
|
+
|
|
130
|
+
## 5. Build-only verification
|
|
131
|
+
|
|
132
|
+
No simulator boot and no phones in this pass: the iOS code is compiled (`xcodebuild -sdk iphonesimulator build`), the C cores have host tests, and every runtime audio claim is on the device test list.
|
|
133
|
+
|
|
134
|
+
## 6. Review notes (Fable review 2026-11-30, addressed)
|
|
135
|
+
|
|
136
|
+
- WebRTC module name: the prefixed bridge name of the 150.2.x build, not `WebRTCModule` (fixed then; on 155 it is `WebRTCModule`).
|
|
137
|
+
- Lifetimes: the capture processor and the ADM proxy are process-lifetime singletons (both delegate properties are weak).
|
|
138
|
+
- WebRTC's software NS/AGC are not switched off natively (RN exports no `initAndStartRecording(audioProcessingOptions:)`): publish the mic with `GravixNoiseSuppression.webrtcProcessingFor(engine)` constraints (`noiseSuppression:false`, `autoGainControl:false`), which RN maps to the goog* constraints. Otherwise our AGC stacks on WebRTC's.
|
|
139
|
+
- VPIO AGC off and the NS reset on an engine rebuild come from the proxy's `configureInput`; route changes also reset NS through the AVAudioSession observer.
|
|
140
|
+
- An app that sets `WebRTCModuleOptions.audioDevice` gets no AudioEngine ADM and no APM, and an app that replaces `audioProcessingModule` after `setup()` drops ours: `GxAudioSetup.isChainLive` re-reads the options for the capability map and `attach`, so the features then report unsupported. Call `setup()` after any own WebRTC options.
|
|
141
|
+
- JS sends no `autoMusic` / `vpioAgcOff`: the native defaults (both on, as in Flutter) apply.
|
|
142
|
+
- Room music options not applied on iOS: musicMaxBitrate, disableDtxWhileMusic, relaxVoiceProcessing, pauseOnInterruption, continueWhileMic*, syncPosition (documented on `GravixRoomMusic`; bitrate/DTX via gravix-rtc `room.setSingerMode`).
|
|
143
|
+
- Review round 2 fixed: the post route no longer bypasses NS + effect during a song; `isInstalled` is an atomic flag (no wait behind a Core ML load); `positionNow` holds on a stale reading and caps extrapolation at 750 ms (Flutter rules); numeric arguments are rounded in JS; unescaped `file://` paths work.
|
|
144
|
+
- A mute that releases the mic also silences room music on iOS and holds its position (it counts capture frames).
|
|
145
|
+
- Simulator: the AudioEngine ADM can report a zero input rate; the chain and the monitor skip rate 0.
|
|
146
|
+
|
|
147
|
+
## 7. Vendored C core changes
|
|
148
|
+
|
|
149
|
+
`native/` (repo root, shared with the Android CMake build) is a copy of Flutter `native/gxns` + `native/gxfx` at 5c4d44c (tests/tools left out), with one change: rnnoise `common.h` and `pitch.c` include `<stdlib.h>`, `<string.h>`, `<math.h>` with angle brackets. The quoted forms resolved through the Pods header map to Folly's `Stdlib.h`; the angle-bracket form builds on Android too. Upstream that change to Flutter so the copies stay identical. The iOS forwarders in `ios/gxcore/apple/units` include the shared files by relative path.
|
|
150
|
+
|
|
151
|
+
## 8b. iPhone checks for the Gravix audio device (2026-12-01, none run)
|
|
152
|
+
|
|
153
|
+
1. Join + publish: Android listener hears the iPhone clearly, no echo (VPIO
|
|
154
|
+
AEC) with speaker and earpiece; iPhone hears remote audio at normal volume.
|
|
155
|
+
2. Listener only (never publishes): no orange mic dot; playout fine.
|
|
156
|
+
3. Mute: orange dot off within ~1 s, `getRecorderState()` `recording` false /
|
|
157
|
+
`captureClosed` true; unmute: voice back within ~0.5 s; a short playout gap
|
|
158
|
+
at each mute / unmute (unit switch) is expected, judge whether acceptable.
|
|
159
|
+
`track.mediaStreamTrack.readyState` stays `live` under the mute (no track
|
|
160
|
+
stop); with `GravixMuteStopsMicTrack` = YES it ends and the unmute
|
|
161
|
+
reacquires (old behaviour).
|
|
162
|
+
3b. Muted reconnect: mute, then force a full reconnect (airplane mode ~10 s,
|
|
163
|
+
or a server-side restart): the orange dot must NOT flash on during the
|
|
164
|
+
republish (`[GravixAudioDevice] step=startRecording captureClosed=1`, no
|
|
165
|
+
`unit=vpio` before the unmute); unmute after: voice back at once. Then a
|
|
166
|
+
muted seat leave (unpublish) + an unmuted publish: the mic opens with the
|
|
167
|
+
publish (`step=stopRecording ... released=1`).
|
|
168
|
+
3c. RN reload (dev menu Reload, debug build) during a call: `step=initialize
|
|
169
|
+
takeover=1`, no crash, audio works after the rejoin; `terminate ignored=1`
|
|
170
|
+
lines from the old factory are expected.
|
|
171
|
+
4. Voice effects, NS standard / studio / auto (`nsGetState` `apmInitRate` = the
|
|
172
|
+
device rate), room music heard by listeners after NS + effect, host monitor
|
|
173
|
+
audible and cancelled from the mic.
|
|
174
|
+
5. Route changes mid-call: Bluetooth HFP (16 kHz) in / out, wired headset,
|
|
175
|
+
AirPods A2DP; rate change rebuilds the unit (`[GravixAudioDevice] step=route`).
|
|
176
|
+
6. Phone call / Siri interruption, then resume; background + lock screen
|
|
177
|
+
(4096-frame slices); media-services reset (Settings > Developer).
|
|
178
|
+
7. CallKit app (`useManualAudio`): audio starts only after `isAudioEnabled`.
|
|
179
|
+
8. Whether WebRTC switches its software AEC on with a custom device (double
|
|
180
|
+
echo cancellation / quality) and its AGC (publish with
|
|
181
|
+
`webrtcProcessingFor`).
|
|
182
|
+
9. Rollback: remove `GravixAudioDevice` (or set NO) for WebRTC's built-in device again.
|
|
183
|
+
|
|
184
|
+
## 8. Device tests needed (none run)
|
|
185
|
+
|
|
186
|
+
1. iPhone, published mic: each voice effect audible to an Android listener; `fxStats` latency; watchdog event.
|
|
187
|
+
2. NS standard / studio / auto: `nsGetState` engine, `apmInitRate` > 0 (proves the slot runs); studio benchmark; thermal/battery fallback; Bluetooth HFP route reset.
|
|
188
|
+
3. Room music: song heard by listeners after NS + effect; host monitor audible (proxy in place, `graphHooked`/`monitorAttached` true); mic volume, ducking, seek, pause, loop, `onCompleted`; route change mid-song (rate change).
|
|
189
|
+
4. Mute releases mic: after `GravixMicRelease.attach` + mute, orange dot off and `getRecorderState().recording` false; unmute restores voice; republish while muted.
|
|
190
|
+
5. Session policy unchanged with the proxy: react-native-webrtc `setupIOSAudioManagement` / automatic config still activates and deactivates the session.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "gravix-rtc-react-native"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/assajeeb/gravix-rtc-react-native.git", :tag => "v#{s.version}" }
|
|
15
|
+
|
|
16
|
+
# iOS audio (voice effects, noise suppression, room music): Swift + Obj-C in
|
|
17
|
+
# ios/audio, and the C/C++ cores vendored from the Flutter SDK in ios/gxcore,
|
|
18
|
+
# compiled only through the forwarders in ios/gxcore/apple/units so the
|
|
19
|
+
# third-party headers never land in a flat header map (rnnoise and speexdsp
|
|
20
|
+
# both have an arch.h). See docs/IOS_NATIVE_HOOKS.md.
|
|
21
|
+
# The capture features run inside the Gravix RTCAudioDevice
|
|
22
|
+
# (ios/audio/GxAudioDevice.m), installed as WebRTCModuleOptions.audioDevice:
|
|
23
|
+
# react-native-webrtc 155's WebRTC build (JitsiWebRTC) has no capture
|
|
24
|
+
# processing slot.
|
|
25
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}", "ios/gxcore/apple/*.c", "ios/gxcore/apple/units/*.{c,cpp}"
|
|
26
|
+
s.exclude_files = "ios/gxcore/**/*.h", "ios/tests/**/*"
|
|
27
|
+
s.preserve_paths = "ios/gxcore/**/*", "native/**/*"
|
|
28
|
+
s.public_header_files = "ios/GravixRtcSetup.h"
|
|
29
|
+
s.private_header_files = "ios/GravixRtc.h", "ios/audio/*.h"
|
|
30
|
+
s.swift_version = "5.0"
|
|
31
|
+
# Noise suppression studio model (DeepFilterNet3, precompiled Core ML, ~2.7 MB) + licences.
|
|
32
|
+
s.resource_bundles = { "gravix_rtc_ns" => ["ios/resources/ns/*"] }
|
|
33
|
+
s.pod_target_xcconfig = {
|
|
34
|
+
"DEFINES_MODULE" => "YES",
|
|
35
|
+
"HEADER_SEARCH_PATHS" => '"$(PODS_TARGET_SRCROOT)/ios/gxcore/apple/include" "$(PODS_TARGET_SRCROOT)/ios/gxcore/apple/shim"',
|
|
36
|
+
"SWIFT_INCLUDE_PATHS" => '"$(PODS_TARGET_SRCROOT)/ios/gxcore/apple/include"',
|
|
37
|
+
# The audio cores run on the real-time capture thread: optimised in Debug too.
|
|
38
|
+
"GCC_OPTIMIZATION_LEVEL" => "2",
|
|
39
|
+
}
|
|
40
|
+
s.frameworks = "AVFAudio", "AVKit", "AVFoundation", "AudioToolbox", "CoreML", "Accelerate"
|
|
41
|
+
|
|
42
|
+
# The WebRTC framework react-native-webrtc 155 links (RTCAudioSession,
|
|
43
|
+
# RTCAudioSessionConfiguration), same constraint as its podspec. Not the
|
|
44
|
+
# react-native-webrtc pod itself: it defines no module, and nothing here
|
|
45
|
+
# imports its headers.
|
|
46
|
+
s.dependency "JitsiWebRTC", "~> 155.0.0"
|
|
47
|
+
|
|
48
|
+
install_modules_dependencies(s)
|
|
49
|
+
end
|