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,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Copyright (c) 2026 Gravity Compile. MIT License; see LICENSE.
|
|
4
|
+
|
|
5
|
+
import { Platform } from 'react-native';
|
|
6
|
+
import { nativeModuleOrNull } from "./native/module.js";
|
|
7
|
+
import { GRAVIX_RTC_RN_VERSION } from "./version.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Native-only Gravix features (Flutter gravix_rtc parity). Each one is gated
|
|
11
|
+
* on a per-platform capability the native module reports; while it is false,
|
|
12
|
+
* every call of that feature throws {@link GravixUnsupportedError}.
|
|
13
|
+
*
|
|
14
|
+
* Keep in sync with `NATIVE_FEATURES` in the Android `GravixRtcModule.kt` and
|
|
15
|
+
* `GravixNativeFeatures()` in the iOS `GravixRtc.mm`.
|
|
16
|
+
*/
|
|
17
|
+
export const NATIVE_FEATURES = ['voiceEffects', 'roomMusic', 'muteReleasesMic', 'noiseSuppression', 'singerMode', 'audioScenario', 'screenShareService'];
|
|
18
|
+
/** Thrown by a native-only feature on a platform where it is not implemented yet. */
|
|
19
|
+
export class GravixUnsupportedError extends Error {
|
|
20
|
+
code = 'not_supported_on_platform';
|
|
21
|
+
constructor(feature, operation, platform) {
|
|
22
|
+
super(`${feature}.${operation} is not yet supported on this platform (${platform}) ` + `by gravix-rtc-react-native ${GRAVIX_RTC_RN_VERSION}. ` + 'Check isFeatureSupported() before calling it.');
|
|
23
|
+
this.name = 'GravixUnsupportedError';
|
|
24
|
+
this.feature = feature;
|
|
25
|
+
this.operation = operation;
|
|
26
|
+
this.platform = platform;
|
|
27
|
+
Object.setPrototypeOf(this, GravixUnsupportedError.prototype);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function allFalse() {
|
|
31
|
+
const out = {};
|
|
32
|
+
for (const f of NATIVE_FEATURES) out[f] = false;
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
let cached;
|
|
36
|
+
|
|
37
|
+
/** The native capability map (read once, then cached). Without the native module every feature is false. */
|
|
38
|
+
export function getCapabilities() {
|
|
39
|
+
if (cached) return cached;
|
|
40
|
+
const features = allFalse();
|
|
41
|
+
const native = nativeModuleOrNull();
|
|
42
|
+
let reported;
|
|
43
|
+
try {
|
|
44
|
+
reported = native ? native.getCapabilities() : undefined;
|
|
45
|
+
} catch {
|
|
46
|
+
reported = undefined;
|
|
47
|
+
}
|
|
48
|
+
const nativeFeatures = reported?.features ?? {};
|
|
49
|
+
for (const f of NATIVE_FEATURES) features[f] = nativeFeatures[f] === true;
|
|
50
|
+
cached = {
|
|
51
|
+
platform: typeof reported?.platform === 'string' ? reported.platform : Platform.OS,
|
|
52
|
+
nativeVersion: typeof reported?.nativeVersion === 'string' ? reported.nativeVersion : null,
|
|
53
|
+
setUp: reported?.setUp === true,
|
|
54
|
+
features
|
|
55
|
+
};
|
|
56
|
+
return cached;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Whether a native-only feature is available on this platform. */
|
|
60
|
+
export function isFeatureSupported(feature) {
|
|
61
|
+
return getCapabilities().features[feature] === true;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Throws {@link GravixUnsupportedError} while `feature` is not supported here.
|
|
66
|
+
* When the native side reports it supported but this JS layer has no binding
|
|
67
|
+
* for `operation` yet, that is an SDK bug, reported as a plain Error.
|
|
68
|
+
*/
|
|
69
|
+
export function unsupported(feature, operation) {
|
|
70
|
+
const caps = getCapabilities();
|
|
71
|
+
if (!caps.features[feature]) {
|
|
72
|
+
throw new GravixUnsupportedError(feature, operation, caps.platform);
|
|
73
|
+
}
|
|
74
|
+
throw new Error(`gravix-rtc-react-native: native ${feature} is reported available on ${caps.platform} ` + `but ${feature}.${operation} has no JS binding in ${GRAVIX_RTC_RN_VERSION}`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Async form of {@link unsupported} for promise-returning APIs. */
|
|
78
|
+
export function unsupportedAsync(feature, operation) {
|
|
79
|
+
try {
|
|
80
|
+
return unsupported(feature, operation);
|
|
81
|
+
} catch (e) {
|
|
82
|
+
return Promise.reject(e);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Test hook. @internal */
|
|
87
|
+
export function __resetCapabilitiesForTests() {
|
|
88
|
+
cached = undefined;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=unsupported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","nativeModuleOrNull","GRAVIX_RTC_RN_VERSION","NATIVE_FEATURES","GravixUnsupportedError","Error","code","constructor","feature","operation","platform","name","Object","setPrototypeOf","prototype","allFalse","out","f","cached","getCapabilities","features","native","reported","undefined","nativeFeatures","OS","nativeVersion","setUp","isFeatureSupported","unsupported","caps","unsupportedAsync","e","Promise","reject","__resetCapabilitiesForTests"],"sourceRoot":"../../src","sources":["unsupported.ts"],"mappings":";;AAAA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,kBAAkB,QAAQ,oBAAiB;AACpD,SAASC,qBAAqB,QAAQ,cAAW;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAG,CAC7B,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,oBAAoB,CACZ;AAcV;AACA,OAAO,MAAMC,sBAAsB,SAASC,KAAK,CAAC;EACvCC,IAAI,GAAG,2BAA2B;EAK3CC,WAAWA,CACTC,OAA4B,EAC5BC,SAAiB,EACjBC,QAAgB,EAChB;IACA,KAAK,CACH,GAAGF,OAAO,IAAIC,SAAS,2CAA2CC,QAAQ,IAAI,GAC5E,8BAA8BR,qBAAqB,IAAI,GACvD,+CACJ,CAAC;IACD,IAAI,CAACS,IAAI,GAAG,wBAAwB;IACpC,IAAI,CAACH,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxBE,MAAM,CAACC,cAAc,CAAC,IAAI,EA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AEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASqB,WAAWA,CACzBrB,OAA4B,EAC5BC,SAAiB,EACV;EACP,MAAMqB,IAAI,GAAGX,eAAe,CAAC,CAAC;EAC9B,IAAI,CAACW,IAAI,CAACV,QAAQ,CAACZ,OAAO,CAAC,EAAE;IAC3B,MAAM,IAAIJ,sBAAsB,CAACI,OAAO,EAAEC,SAAS,EAAEqB,IAAI,CAACpB,QAAQ,CAAC;EACrE;EACA,MAAM,IAAIL,KAAK,CACb,mCAAmCG,OAAO,6BAA6BsB,IAAI,CAACpB,QAAQ,GAAG,GACrF,OAAOF,OAAO,IAAIC,SAAS,yBAAyBP,qBAAqB,EAC7E,CAAC;AACH;;AAEA;AACA,OAAO,SAAS6B,gBAAgBA,CAC9BvB,OAA4B,EAC5BC,SAAiB,EACD;EAChB,IAAI;IACF,OAAOoB,WAAW,CAACrB,OAAO,EAAEC,SAAS,CAAC;EACxC,CAAC,CAAC,OAAOuB,CAAC,EAAE;IACV,OAAOC,OAAO,CAACC,MAAM,CAACF,CAAC,CAAC;EAC1B;AACF;;AAEA;AACA,OAAO,SAASG,2BAA2BA,CAAA,EAAS;EAClDjB,MAAM,GAAGK,SAAS;AACpB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GRAVIX_RTC_RN_VERSION"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;AAAA;;AAEA;AACA,OAAO,MAAMA,qBAAqB,GAAG,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type GravixNativeFeature } from '../unsupported.js';
|
|
2
|
+
import { type GravixAndroidAudioBridge } from './nativeAudio.js';
|
|
3
|
+
/** Device event of `GravixAudioModule.kt`: `{ name, payload }`. */
|
|
4
|
+
export declare const GRAVIX_AUDIO_EVENT = "GravixAudioEvent";
|
|
5
|
+
/** Installs the bridge over the `GravixAudio` TurboModule (Android). Idempotent; false when absent. */
|
|
6
|
+
export declare function installGravixAndroidAudioBridge(): boolean;
|
|
7
|
+
/** The bridge, installed on first use. Null off Android or without the module. */
|
|
8
|
+
export declare function androidAudio(): GravixAndroidAudioBridge | null;
|
|
9
|
+
/**
|
|
10
|
+
* The bridge when [feature] runs natively here (Android, `GravixRtc.setup` done,
|
|
11
|
+
* capability flag on), else null: the caller then keeps its `unsupported*()` path.
|
|
12
|
+
*/
|
|
13
|
+
export declare function androidAudioFor(feature: GravixNativeFeature): GravixAndroidAudioBridge | null;
|
|
14
|
+
//# sourceMappingURL=bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../../../src/android/bindings.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,mBAAgB,CAAC;AAC9E,OAAO,EAGL,KAAK,wBAAwB,EAG9B,MAAM,kBAAe,CAAC;AAEvB,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD,uGAAuG;AACvG,wBAAgB,+BAA+B,IAAI,OAAO,CA0BzD;AAED,kFAAkF;AAClF,wBAAgB,YAAY,IAAI,wBAAwB,GAAG,IAAI,CAG9D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,mBAAmB,GAC3B,wBAAwB,GAAG,IAAI,CAGjC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Android-native audio features (voice effects, noise suppression, room music, singer mode, mic release). */
|
|
2
|
+
export * from './nativeAudio.js';
|
|
3
|
+
export * from './voiceEffects.js';
|
|
4
|
+
export * from './noiseSuppression.js';
|
|
5
|
+
export * from './roomMusic.js';
|
|
6
|
+
export * from './singerMode.js';
|
|
7
|
+
export * from './micMute.js';
|
|
8
|
+
export * from './bindings.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/android/index.ts"],"names":[],"mappings":"AAEA,8GAA8G;AAC9G,cAAc,kBAAe,CAAC;AAC9B,cAAc,mBAAgB,CAAC;AAC/B,cAAc,uBAAoB,CAAC;AACnC,cAAc,gBAAa,CAAC;AAC5B,cAAc,iBAAc,CAAC;AAC7B,cAAc,cAAW,CAAC;AAC1B,cAAc,eAAY,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mute that releases the OS microphone (Flutter SDK 0.12.1 / 0.12.2, Android).
|
|
3
|
+
*
|
|
4
|
+
* In React Native a plain mute of a published mic (`LocalAudioTrack.mute()`
|
|
5
|
+
* of the gravix-rtc core = `MediaStreamTrack.enabled = false`) does not stop
|
|
6
|
+
* the AudioRecord of react-native-webrtc 155's WebRTC build. The Gravix
|
|
7
|
+
* capture seam closes it instead: {@link GravixMicMute.setCaptureClosed}
|
|
8
|
+
* (the room mic policy calls it on every local mic mute / unmute) stops the
|
|
9
|
+
* hardware recorder while WebRTC's record thread keeps clocking silence, so
|
|
10
|
+
* the OS mic indicator goes off (0.12.1 behaviour). Two cases need more,
|
|
11
|
+
* ported here over the native primitives (`setMicrophoneMute`,
|
|
12
|
+
* `setRecorderReleased`, `recorderNativeState`, `setCaptureClosed`):
|
|
13
|
+
*
|
|
14
|
+
* 1. Room music under a mute ({@link GravixMicMute.muteForMusic}, 0.12.2,
|
|
15
|
+
* `continueWhileMicReleased`): the voice is zeroed in the module, then the
|
|
16
|
+
* hardware recorder is released while WebRTC's record thread keeps
|
|
17
|
+
* delivering frames (silence + the music, clocked by the mixer). The track
|
|
18
|
+
* stays enabled and published (no mute signal): the room keeps hearing the
|
|
19
|
+
* music, the OS mic indicator goes off.
|
|
20
|
+
* 2. A mic published while ALREADY muted ({@link GravixMicMute.closeMutedCapture}):
|
|
21
|
+
* WebRTC starts the recorder when the send stream is added, muted or not.
|
|
22
|
+
* With the capture seam the recorder is simply closed; without it (a
|
|
23
|
+
* native side that lacks `setCaptureClosed`) the stream is unmuted and
|
|
24
|
+
* muted again once under the module mute, until the recorder is seen
|
|
25
|
+
* stopped (at most 3 rounds).
|
|
26
|
+
*/
|
|
27
|
+
/** The parts of a gravix-rtc `LocalAudioTrack` this needs. */
|
|
28
|
+
export interface GravixMicTrackLike {
|
|
29
|
+
readonly isMuted: boolean;
|
|
30
|
+
readonly mediaStreamTrack: {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
};
|
|
33
|
+
mute(): Promise<unknown>;
|
|
34
|
+
unmute(): Promise<unknown>;
|
|
35
|
+
}
|
|
36
|
+
export interface GravixMicNative {
|
|
37
|
+
setMicrophoneMute(mute: boolean): Promise<boolean>;
|
|
38
|
+
setRecorderReleased(released: boolean, opts?: {
|
|
39
|
+
waitOpen?: boolean;
|
|
40
|
+
timeoutMs?: number;
|
|
41
|
+
}): Promise<boolean>;
|
|
42
|
+
recorderNativeState(): Promise<Record<string, boolean> | null>;
|
|
43
|
+
/** Closes (true) or reopens the hardware recorder for a mute; null: not available. */
|
|
44
|
+
setCaptureClosed?(closed: boolean): Promise<boolean | null>;
|
|
45
|
+
}
|
|
46
|
+
/** The native primitives through the Android bridge; no-ops (false / null) without it. */
|
|
47
|
+
export declare const bridgeMicNative: GravixMicNative;
|
|
48
|
+
export type GravixMicMuteKind = 'none' | 'voiceOnlyReleased' | 'voiceOnly';
|
|
49
|
+
/**
|
|
50
|
+
* Engine-wide state (one audio device module per process), port of Dart
|
|
51
|
+
* `GravixEngineMicMute` + the matching `LocalAudioTrack` flows.
|
|
52
|
+
*/
|
|
53
|
+
export declare class GravixMicMute {
|
|
54
|
+
private readonly native;
|
|
55
|
+
private readonly sleep;
|
|
56
|
+
private readonly log;
|
|
57
|
+
/**
|
|
58
|
+
* `GravixMicRelease.setMuteReleasesMic`: a mute under room music may release
|
|
59
|
+
* the recorder. Default true (Flutter 0.12.1+ `muteReleasesMic`); rollback:
|
|
60
|
+
* `registerGlobals({ muteReleasesMic: false })`.
|
|
61
|
+
*/
|
|
62
|
+
muteReleasesMic: boolean;
|
|
63
|
+
private readonly listeners;
|
|
64
|
+
private engaged;
|
|
65
|
+
private recorderReleased;
|
|
66
|
+
private kind;
|
|
67
|
+
private owner;
|
|
68
|
+
constructor(native?: GravixMicNative, sleep?: (ms: number) => Promise<void>, log?: (level: 'info' | 'warn' | 'error', msg: string) => void);
|
|
69
|
+
get muteKind(): GravixMicMuteKind;
|
|
70
|
+
/** Called on every voice-only mute change ({@link muteKind}). Returns the unsubscribe. */
|
|
71
|
+
onChange(fn: () => void): () => void;
|
|
72
|
+
/** @internal */
|
|
73
|
+
setKind(kind: GravixMicMuteKind, owner: GravixMicTrackLike | null): void;
|
|
74
|
+
/**
|
|
75
|
+
* Mute releases the mic (stock WebRTC keeps recording under a track mute):
|
|
76
|
+
* closes / reopens the hardware recorder through the capture seam. Null when
|
|
77
|
+
* the native side has no seam (then nothing changed). Off while
|
|
78
|
+
* {@link muteReleasesMic} is false (the reopen always runs).
|
|
79
|
+
*/
|
|
80
|
+
setCaptureClosed(closed: boolean): Promise<boolean | null>;
|
|
81
|
+
/** The room is gone: a voice-only mute and the module mute are given back. */
|
|
82
|
+
leave(): Promise<void>;
|
|
83
|
+
get isEngaged(): boolean;
|
|
84
|
+
get isRecorderReleased(): boolean;
|
|
85
|
+
/** The module mute (PCM zeroed, recorder running). False: not available (no setup / not Android). */
|
|
86
|
+
engage(): Promise<boolean>;
|
|
87
|
+
releaseRecorder(): Promise<boolean>;
|
|
88
|
+
restoreRecorder(waitOpen: boolean): Promise<boolean>;
|
|
89
|
+
/** Gives back the module mute (a released recorder first). */
|
|
90
|
+
release(): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Mute while room music plays. [releaseMic] = `continueWhileMicReleased`.
|
|
93
|
+
* Returns the kind of mute taken; `none` means the caller's plain
|
|
94
|
+
* `track.mute()` ran instead (music silenced for the room: the 0.12.1 mute).
|
|
95
|
+
*/
|
|
96
|
+
muteForMusic(track: GravixMicTrackLike, releaseMic: boolean): Promise<GravixMicMuteKind>;
|
|
97
|
+
/** Unmute of a {@link muteForMusic} mute (a plain mute: call `track.unmute()` yourself). */
|
|
98
|
+
unmuteFromMusic(track: GravixMicTrackLike): Promise<boolean>;
|
|
99
|
+
/**
|
|
100
|
+
* The music ended while {@link muteForMusic} held: becomes a plain mute
|
|
101
|
+
* (wire signalled; the room mic policy closes the recorder through the
|
|
102
|
+
* capture seam when mute releases the mic).
|
|
103
|
+
*/
|
|
104
|
+
musicEnded(track: GravixMicTrackLike): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* The app muted the track through the core (`setMicrophoneEnabled(false)`)
|
|
107
|
+
* during a voice-only mute: the core now owns the mute. The recorder flag
|
|
108
|
+
* and the module mute are given back so a later core unmute carries voice.
|
|
109
|
+
*/
|
|
110
|
+
coreMuted(track: GravixMicTrackLike): Promise<void>;
|
|
111
|
+
/** `setMuteReleasesMic(false)` under a released mute: the recorder is back, the voice stays muted. */
|
|
112
|
+
unreleaseKeepingMute(): Promise<void>;
|
|
113
|
+
private waitRecorder;
|
|
114
|
+
/**
|
|
115
|
+
* Closes the recorder of a mic published while already muted (device
|
|
116
|
+
* 2026-11-28: WebRTC starts it ~300 ms after the publish returns; a toggle
|
|
117
|
+
* before that changes nothing). Returns true when the recorder was seen
|
|
118
|
+
* stopped (or the state is unreadable after one toggle).
|
|
119
|
+
*/
|
|
120
|
+
closeMutedCapture(track: GravixMicTrackLike): Promise<boolean>;
|
|
121
|
+
}
|
|
122
|
+
/** Process-wide instance (the audio device module is one per process). */
|
|
123
|
+
export declare const gravixMicMute: GravixMicMute;
|
|
124
|
+
//# sourceMappingURL=micMute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"micMute.d.ts","sourceRoot":"","sources":["../../../../src/android/micMute.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;A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AAI,CAAC;IAOzD,sGAAsG;IAChG,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;YAM7B,YAAY;IAe1B;;;;;OAKG;IACG,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;CA8ErE;AAED,0EAA0E;AAC1E,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge to the Android-native audio features (`GravixNativeAudio.kt`): one
|
|
3
|
+
* call with the Flutter SDK's method names and argument maps, plus native
|
|
4
|
+
* events. The TurboModule binding installs itself with
|
|
5
|
+
* {@link setGravixAndroidAudioBridge}; tests install a fake.
|
|
6
|
+
*/
|
|
7
|
+
export type GravixAndroidAudioEvent = 'onVoiceEffects' | 'onNoiseSuppression' | 'onMicrophoneFailure' | 'music.onCompleted' | 'music.onError' | 'music.onInterruption';
|
|
8
|
+
export type GravixAndroidAudioListener = (payload: Record<string, unknown> | null) => void;
|
|
9
|
+
export interface GravixAndroidAudioBridge {
|
|
10
|
+
call(method: string, args?: Record<string, unknown>): Promise<unknown>;
|
|
11
|
+
addListener(event: GravixAndroidAudioEvent, listener: GravixAndroidAudioListener): () => void;
|
|
12
|
+
}
|
|
13
|
+
/** Thrown when the native side is missing (iOS, web, no `GravixRtc.setup`). */
|
|
14
|
+
export declare class GravixNativeUnavailableError extends Error {
|
|
15
|
+
readonly code = "NATIVE_UNAVAILABLE";
|
|
16
|
+
constructor(feature: string, why: string);
|
|
17
|
+
}
|
|
18
|
+
export declare function setGravixAndroidAudioBridge(b: GravixAndroidAudioBridge | null): void;
|
|
19
|
+
export declare function gravixAndroidAudioBridge(): GravixAndroidAudioBridge | null;
|
|
20
|
+
export declare function requireBridge(feature: string): GravixAndroidAudioBridge;
|
|
21
|
+
/** The native capability map (`GravixNativeAudio.capabilities`). */
|
|
22
|
+
export interface GravixAndroidAudioCapabilities {
|
|
23
|
+
/** `GravixRtc.setup` ran (our audio device module exists). */
|
|
24
|
+
setup: boolean;
|
|
25
|
+
/** Our module / processing are still the ones WebRTC uses (another library may replace them). */
|
|
26
|
+
admInstalled: boolean;
|
|
27
|
+
processingInstalled: boolean;
|
|
28
|
+
/** WebRTC created its factory (and with it our capture post-processing). */
|
|
29
|
+
processingCreated: boolean;
|
|
30
|
+
audioScenario: 'standard' | 'chatRoom';
|
|
31
|
+
voiceEffects: boolean;
|
|
32
|
+
noiseSuppression: boolean;
|
|
33
|
+
roomMusic: boolean;
|
|
34
|
+
singerMode: boolean;
|
|
35
|
+
muteReleasesMic: boolean;
|
|
36
|
+
audioScenarioSupported?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare function androidAudioCapabilities(): Promise<GravixAndroidAudioCapabilities | null>;
|
|
39
|
+
export declare function asMap(v: unknown): Record<string, unknown> | null;
|
|
40
|
+
//# sourceMappingURL=nativeAudio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeAudio.d.ts","sourceRoot":"","sources":["../../../../src/android/nativeAudio.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,MAAM,MAAM,uBAAuB,GAC/B,gBAAgB,GAChB,oBAAoB,GACpB,qBAAqB,GACrB,mBAAmB,GACnB,eAAe,GACf,sBAAsB,CAAC;AAE3B,MAAM,MAAM,0BAA0B,GAAG,CACvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,KACpC,IAAI,CAAC;AAEV,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvE,WAAW,CACT,KAAK,EAAE,uBAAuB,EAC9B,QAAQ,EAAE,0BAA0B,GACnC,MAAM,IAAI,CAAC;CACf;AAED,+EAA+E;AAC/E,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,IAAI,wBAAwB;gBACzB,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;CAIzC;AAID,wBAAgB,2BAA2B,CACzC,CAAC,EAAE,wBAAwB,GAAG,IAAI,GACjC,IAAI,CAEN;AAED,wBAAgB,wBAAwB,IAAI,wBAAwB,GAAG,IAAI,CAE1E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,wBAAwB,CAQvE;AAED,oEAAoE;AACpE,MAAM,WAAW,8BAA8B;IAC7C,8DAA8D;IAC9D,KAAK,EAAE,OAAO,CAAC;IACf,iGAAiG;IACjG,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,4EAA4E;IAC5E,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,UAAU,GAAG,UAAU,CAAC;IACvC,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,8BAA8B,GAAG,IAAI,CAAC,CAS/F;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAIhE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type GravixNoiseSuppressionMode, type GravixNoiseSuppressionOptions, type GravixNsDeviceFacts, type GravixNsEngine } from 'gravix-rtc';
|
|
2
|
+
/**
|
|
3
|
+
* On-device noise suppression on Android (native gx_ns: RNNoise `standard`,
|
|
4
|
+
* DeepFilterNet3 `studio` on arm64), the levels of the Flutter SDK:
|
|
5
|
+
* `off` | `standard` | `studio` | `auto`. The engine is resolved in JS with
|
|
6
|
+
* the shared resolver of the `gravix-rtc` core (same policy fixture as
|
|
7
|
+
* Flutter / web), then configured natively (Flutter `nsConfigure`).
|
|
8
|
+
*
|
|
9
|
+
* WebRTC's own NS / AGC should be off on the microphone while ours runs: the
|
|
10
|
+
* caller captures the mic with `noiseSuppression: false, autoGainControl:
|
|
11
|
+
* false` (echo cancellation on) when {@link GravixAndroidNsState.engine} is
|
|
12
|
+
* ours, exactly as the web SDK does (`disableWebRtcNs`).
|
|
13
|
+
*/
|
|
14
|
+
export interface GravixAndroidNsState {
|
|
15
|
+
mode: GravixNoiseSuppressionMode;
|
|
16
|
+
/** The engine actually running (`off` = none of ours). */
|
|
17
|
+
engine: GravixNsEngine;
|
|
18
|
+
reason: string;
|
|
19
|
+
/** On WebRTC's capture post-processing slot. */
|
|
20
|
+
installed: boolean;
|
|
21
|
+
route?: string;
|
|
22
|
+
rate?: number;
|
|
23
|
+
}
|
|
24
|
+
/** Static device facts from the native side (model, soc, abi, RAM, ...). */
|
|
25
|
+
export declare function androidNsDeviceFacts(): Promise<GravixNsDeviceFacts & {
|
|
26
|
+
studioAvailable?: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
/** The `nsConfigure` arguments for [o] resolved to [engine] (Flutter GravixNoiseController). */
|
|
29
|
+
export declare function androidNsConfigureArgs(o: GravixNoiseSuppressionOptions, engine: GravixNsEngine, reason: string): Record<string, unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Resolves and applies the noise suppression level. `auto` without a cached
|
|
32
|
+
* benchmark runs RNNoise first and benchmarks studio in the background; once
|
|
33
|
+
* the benchmark is in, call this again (or pass `rerunAfterBenchmark`).
|
|
34
|
+
*/
|
|
35
|
+
export declare function configureAndroidNoiseSuppression(options?: Partial<GravixNoiseSuppressionOptions> & {
|
|
36
|
+
autoMusic?: boolean;
|
|
37
|
+
}, opts?: {
|
|
38
|
+
rerunAfterBenchmark?: boolean;
|
|
39
|
+
}): Promise<GravixAndroidNsState>;
|
|
40
|
+
/** SDK version in the benchmark key: a new native build re-benchmarks. */
|
|
41
|
+
export declare const GRAVIX_RN_NS_SDK_VERSION = "rn-android-0.1.0";
|
|
42
|
+
/** Same key shape as Flutter / web (`nsBenchmarkKey`); null without a studio model. */
|
|
43
|
+
export declare function androidNsBenchmarkKey(facts: Record<string, unknown>): string | null;
|
|
44
|
+
/** The native state map (`nsStats`): engine, rate, route, stats. */
|
|
45
|
+
export declare function androidNoiseSuppressionStats(): Promise<Record<string, unknown> | null>;
|
|
46
|
+
/** Test seam. */
|
|
47
|
+
export declare function __resetAndroidNsForTests(): void;
|
|
48
|
+
//# sourceMappingURL=noiseSuppression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noiseSuppression.d.ts","sourceRoot":"","sources":["../../../../src/android/noiseSuppression.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAElC,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAGpB;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,0BAA0B,CAAC;IACjC,0DAA0D;IAC1D,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAiBD,4EAA4E;AAC5E,wBAAsB,oBAAoB,IAAI,OAAO,CACnD,mBAAmB,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CACpD,CAMA;AAED,gGAAgG;AAChG,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,6BAA6B,EAChC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqBzB;AAED;;;;GAIG;AACH,wBAAsB,gCAAgC,CACpD,OAAO,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,EAC1E,IAAI,GAAE;IAAE,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,OAAO,CAAC,oBAAoB,CAAC,CAiE/B;AAED,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAE3D,uFAAuF;AACvF,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,GAAG,IAAI,CASf;AAeD,oEAAoE;AACpE,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,MAAM,CAClE,MAAM,EACN,OAAO,CACR,GAAG,IAAI,CAAC,CAER;AAED,iBAAiB;AACjB,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type GravixAndroidAudioListener } from './nativeAudio.js';
|
|
2
|
+
/**
|
|
3
|
+
* Karaoke / room music on Android: a local file or content URI decoded
|
|
4
|
+
* natively and mixed INTO the published microphone (one stream, no second
|
|
5
|
+
* track, no server bot), with the host's local monitor, mic volume, ducking,
|
|
6
|
+
* loop and seek. Port of the Flutter SDK's `GravixRoomMusic` native layer
|
|
7
|
+
* (`MusicMixerEngine`, channel `com.gravitycompile.gravix_rtc/music`).
|
|
8
|
+
*
|
|
9
|
+
* Needs a running microphone capture (publish the mic first):
|
|
10
|
+
* `CAPTURE_NOT_READY` otherwise.
|
|
11
|
+
*/
|
|
12
|
+
export interface GravixAndroidMusicOptions {
|
|
13
|
+
/** Music level 0..1 in the mix and the host's monitor (default 1). */
|
|
14
|
+
musicVolume?: number;
|
|
15
|
+
/** Voice level 0..1 in the mix (default 1). */
|
|
16
|
+
micVolume?: number;
|
|
17
|
+
/** Lower the music while the host talks (default false). */
|
|
18
|
+
ducking?: boolean;
|
|
19
|
+
/** Music gain while ducked, 0..1 (default 0.35). */
|
|
20
|
+
duckLevel?: number;
|
|
21
|
+
loop?: boolean;
|
|
22
|
+
/** The host hears the music locally (default true). */
|
|
23
|
+
monitor?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* While music plays a mic mute removes only the voice; the music keeps
|
|
26
|
+
* reaching the room (default true). False: a mute silences both
|
|
27
|
+
* (`holdOnMute` natively).
|
|
28
|
+
*/
|
|
29
|
+
continueWhileMicMuted?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 0.12.2: with `continueWhileMicMuted`, the mute closes the HARDWARE mic
|
|
32
|
+
* (OS mic indicator off) while the music keeps going (default true). Used
|
|
33
|
+
* by {@link GravixMicMute}; false = the 0.12.1 rollback.
|
|
34
|
+
*/
|
|
35
|
+
continueWhileMicReleased?: boolean;
|
|
36
|
+
/** Pause on a call / audio-focus loss; a transient one resumes (default true). */
|
|
37
|
+
pauseOnInterruption?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const DEFAULT_ANDROID_MUSIC_OPTIONS: Required<GravixAndroidMusicOptions>;
|
|
40
|
+
export interface GravixMusicNativeState {
|
|
41
|
+
active: boolean;
|
|
42
|
+
paused: boolean;
|
|
43
|
+
interrupted: string | null;
|
|
44
|
+
positionMs: number;
|
|
45
|
+
durationMs: number;
|
|
46
|
+
captureLive: boolean;
|
|
47
|
+
captureSampleRate: number;
|
|
48
|
+
captureChannels: number;
|
|
49
|
+
installed: boolean;
|
|
50
|
+
mixRoute: string;
|
|
51
|
+
micReleased: boolean;
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
/** The `music.start` arguments (Flutter MusicMixerPlugin keys). */
|
|
55
|
+
export declare function musicStartArgs(source: string, o?: GravixAndroidMusicOptions): Record<string, unknown>;
|
|
56
|
+
/** One room-music session at a time (the native mixer is process-wide). */
|
|
57
|
+
export declare class GravixAndroidRoomMusic {
|
|
58
|
+
private options;
|
|
59
|
+
constructor(options?: GravixAndroidMusicOptions);
|
|
60
|
+
get currentOptions(): Readonly<Required<GravixAndroidMusicOptions>>;
|
|
61
|
+
private call;
|
|
62
|
+
/** Starts [source] (file path or content:// URI), replacing a running one. Returns the duration (ms, -1 unknown). */
|
|
63
|
+
start(source: string, options?: GravixAndroidMusicOptions): Promise<number>;
|
|
64
|
+
pause(): Promise<unknown>;
|
|
65
|
+
resume(): Promise<unknown>;
|
|
66
|
+
stop(): Promise<unknown>;
|
|
67
|
+
seek(positionMs: number): Promise<unknown>;
|
|
68
|
+
setMusicVolume(volume: number): Promise<unknown>;
|
|
69
|
+
setMicVolume(volume: number): Promise<unknown>;
|
|
70
|
+
setDucking(on: boolean, level?: number): Promise<unknown>;
|
|
71
|
+
setLoop(on: boolean): Promise<unknown>;
|
|
72
|
+
/** continueWhileMicMuted / pauseOnInterruption at runtime. */
|
|
73
|
+
configure(o: Pick<GravixAndroidMusicOptions, 'continueWhileMicMuted' | 'pauseOnInterruption' | 'continueWhileMicReleased'>): Promise<unknown>;
|
|
74
|
+
isActive(): Promise<boolean>;
|
|
75
|
+
getState(): Promise<GravixMusicNativeState | null>;
|
|
76
|
+
onCompleted(l: () => void): () => void;
|
|
77
|
+
onError(l: GravixAndroidAudioListener): () => void;
|
|
78
|
+
onInterruption(l: GravixAndroidAudioListener): () => void;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=roomMusic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roomMusic.d.ts","sourceRoot":"","sources":["../../../../src/android/roomMusic.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,kBAAe,CAAC;AAEvB;;;;;;;;;GASG;AACH,MAAM,WAAW,yBAAyB;IACxC,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oDAAoD;IACpD,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I,OAAO,CAAC,OAAO,CAAC;IAGzB,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAG1B,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAGxB,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK1C,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9C,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKzD,OAAO,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAItC,8DAA8D;IAC9D,SAAS,CACP,CAAC,EAAE,IAAI,CACL,yBAAyB,EACvB,uBAAuB,GACvB,qBAAqB,GACrB,0BAA0B,CAC7B,GACA,OAAO,CAAC,OAAO,CAAC;IAOb,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAG5B,QAAQ,IAAI,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAIxD,WAAW,CAAC,CAAC,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAKtC,OAAO,CAAC,CAAC,EAAE,0BAA0B,GAAG,MAAM,IAAI;IAGlD,cAAc,CAAC,CAAC,EAAE,0BAA0B,GAAG,MAAM,IAAI;CAG1D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Android-native half of singer mode (Flutter `nsSetSingerMode`): our
|
|
3
|
+
* NS / AGC / pause expander bypassed (limiter near clip kept), the singer
|
|
4
|
+
* level normaliser, and WebRTC's recorder re-opened with the singer capture
|
|
5
|
+
* source (no audio device module rebuild). The browser-style half (WebRTC
|
|
6
|
+
* processing off, bitrate, DTX) is the gravix-rtc core's `room.setSingerMode`.
|
|
7
|
+
*/
|
|
8
|
+
export type GravixSingerCaptureSource = 'mic' | 'voiceRecognition' | 'unprocessed' | 'keep';
|
|
9
|
+
export interface GravixAndroidSingerOptions {
|
|
10
|
+
/** Recorder source while on (default `mic`). */
|
|
11
|
+
source?: GravixSingerCaptureSource;
|
|
12
|
+
levelNormalizer?: boolean;
|
|
13
|
+
levelTargetDbfs?: number;
|
|
14
|
+
levelMaxGainDb?: number;
|
|
15
|
+
levelRiseDbPerSec?: number;
|
|
16
|
+
levelOnWired?: boolean;
|
|
17
|
+
levelOnBluetooth?: boolean;
|
|
18
|
+
builtInMakeupDb?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface GravixAndroidSingerResult {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
/** MediaRecorder.AudioSource asked for (null = kept). */
|
|
23
|
+
sourceRequested: number | null;
|
|
24
|
+
unprocessedSupported: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function setAndroidSingerMode(on: boolean, o?: GravixAndroidSingerOptions): Promise<GravixAndroidSingerResult>;
|
|
27
|
+
//# sourceMappingURL=singerMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singerMode.d.ts","sourceRoot":"","sources":["../../../../src/android/singerMode.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GACnC,KAAK,GAAG,kBAAkB,GAAG,aAAa,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,0BAA0B;IACzC,gDAAgD;IAChD,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,OAAO,CAAC;IACZ,yDAAyD;IACzD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,OAAO,EACX,CAAC,GAAE,0BAA+B,GACjC,OAAO,CAAC,yBAAyB,CAAC,CAgBpC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { GravixVoiceEffect, GravixVoiceEffectStats } from 'gravix-rtc/noise';
|
|
2
|
+
/**
|
|
3
|
+
* Voice effects on the published microphone (Android, native gxfx): the same
|
|
4
|
+
* 35 presets + `none` as the Flutter, Android and web SDKs, in the same order.
|
|
5
|
+
* Runs after noise suppression on WebRTC's capture post-processing slot; room
|
|
6
|
+
* music is mixed after the effect while one is on.
|
|
7
|
+
*/
|
|
8
|
+
export interface GravixVoiceEffectResult {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
/** ok | unknown_effect | library_missing | failed */
|
|
11
|
+
reason: string;
|
|
12
|
+
effect?: GravixVoiceEffect;
|
|
13
|
+
active?: GravixVoiceEffect;
|
|
14
|
+
/** On WebRTC's capture post-processing slot. */
|
|
15
|
+
installed?: boolean;
|
|
16
|
+
latencyMs?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Same set and order as `GRAVIX_VOICE_EFFECTS` in `gravix-rtc/noise` and
|
|
20
|
+
* `GxVoiceFx.PRESETS` (the index is the engine's preset number). Kept here so
|
|
21
|
+
* the React Native bundle never loads the web WASM / worklet module; a test
|
|
22
|
+
* pins it to both.
|
|
23
|
+
*/
|
|
24
|
+
export declare const GRAVIX_ANDROID_VOICE_EFFECTS: readonly GravixVoiceEffect[];
|
|
25
|
+
export declare function isGravixVoiceEffect(v: unknown): v is GravixVoiceEffect;
|
|
26
|
+
export declare function setAndroidVoiceEffect(effect: GravixVoiceEffect): Promise<GravixVoiceEffectResult>;
|
|
27
|
+
export declare function androidVoiceEffectStats(): Promise<GravixVoiceEffectStats | null>;
|
|
28
|
+
/** Runs [effect] on a private chain, off the audio path (device capability check). */
|
|
29
|
+
export declare function benchmarkAndroidVoiceEffect(effect?: GravixVoiceEffect, rate?: number, seconds?: number): Promise<Record<string, unknown> | null>;
|
|
30
|
+
//# sourceMappingURL=voiceEffects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voiceEffects.d.ts","sourceRoot":"","sources":["../../../../src/android/voiceEffects.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAG1B;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,OAAO,CAAC;IACZ,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,SAAS,iBAAiB,EAqCpE,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,iBAAiB,CAKtE;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,uBAAuB,CAAC,CAelC;AAED,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CActF;AAED,sFAAsF;AACtF,wBAAsB,2BAA2B,CAC/C,MAAM,GAAE,iBAA0B,EAClC,IAAI,SAAQ,EACZ,OAAO,SAAI,GACV,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAQzC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AppleAudioConfiguration } from './AudioSession.js';
|
|
2
|
+
/** The audio engine state an iOS session policy is chosen for. */
|
|
3
|
+
export type AudioEngineConfigurationState = {
|
|
4
|
+
isPlayoutEnabled: boolean;
|
|
5
|
+
isRecordingEnabled: boolean;
|
|
6
|
+
isVoiceProcessingEnabled: boolean;
|
|
7
|
+
preferSpeakerOutput: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** Per-engine-state AVAudioSession configuration, applied natively without a JS round trip. */
|
|
10
|
+
export type IOSAudioSessionPolicy = {
|
|
11
|
+
recording: AppleAudioConfiguration;
|
|
12
|
+
recordingWithoutVoiceProcessing?: AppleAudioConfiguration;
|
|
13
|
+
playout: AppleAudioConfiguration;
|
|
14
|
+
/** Deactivate the session when neither playout nor recording runs. Default true. */
|
|
15
|
+
deactivateOnStop?: boolean;
|
|
16
|
+
};
|
|
17
|
+
/** The default iOS session for an engine state. */
|
|
18
|
+
export declare function getDefaultAppleAudioConfigurationForAudioState(state: AudioEngineConfigurationState): AppleAudioConfiguration;
|
|
19
|
+
/**
|
|
20
|
+
* iOS: the AVAudioSession configuration WebRTC applies itself when its audio
|
|
21
|
+
* unit starts (react-native-webrtc 155's built-in audio device module
|
|
22
|
+
* activates and deactivates the session around playout/recording). Called by
|
|
23
|
+
* `registerGlobals()` unless `autoConfigureAudioSession: false`. Returns a
|
|
24
|
+
* cleanup function. No-op on Android.
|
|
25
|
+
*
|
|
26
|
+
* The policy's `recording` entry is the configuration applied; this WebRTC
|
|
27
|
+
* build has one session configuration for its audio unit, so
|
|
28
|
+
* `recordingWithoutVoiceProcessing`, `playout` and `deactivateOnStop` are not
|
|
29
|
+
* applied separately (kept in the type for compatibility).
|
|
30
|
+
*/
|
|
31
|
+
export declare function setupIOSAudioManagement(preferSpeakerOutput?: boolean, policy?: IOSAudioSessionPolicy): () => void;
|
|
32
|
+
//# sourceMappingURL=AudioManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioManager.d.ts","sourceRoot":"","sources":["../../../../src/audio/AudioManager.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,mBAAgB,CAAC;AAExB,kEAAkE;AAClE,MAAM,MAAM,6BAA6B,GAAG;IAC1C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,wBAAwB,EAAE,OAAO,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,+FAA+F;AAC/F,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,uBAAuB,CAAC;IACnC,+BAA+B,CAAC,EAAE,uBAAuB,CAAC;IAC1D,OAAO,EAAE,uBAAuB,CAAC;IACjC,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAaF,mDAAmD;AACnD,wBAAgB,8CAA8C,CAC5D,KAAK,EAAE,6BAA6B,GACnC,uBAAuB,CA+BzB;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,mBAAmB,UAAO,EAC1B,MAAM,CAAC,EAAE,qBAAqB,GAC7B,MAAM,IAAI,CAkBZ"}
|