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,64 @@
|
|
|
1
|
+
import { type GravixNoiseSuppressionMode, type GravixNoiseSuppressionOptions } from 'gravix-rtc';
|
|
2
|
+
/**
|
|
3
|
+
* On-device noise suppression of the published mic (RNNoise "standard",
|
|
4
|
+
* DFN3 "studio"; Flutter `GravixNoiseController`). The mode and option types
|
|
5
|
+
* are gravix-rtc's own, so policy/report logic stays shared. Native-only:
|
|
6
|
+
* until the platform implements it, every call throws `GravixUnsupportedError`.
|
|
7
|
+
* WebRTC's built-in noise suppression keeps working regardless.
|
|
8
|
+
*/
|
|
9
|
+
export interface GravixNoiseSuppressionState {
|
|
10
|
+
mode: GravixNoiseSuppressionMode;
|
|
11
|
+
/** The engine that runs now. */
|
|
12
|
+
engine: 'off' | 'rnnoise' | 'dfn3' | 'webrtc';
|
|
13
|
+
/** Why the engine differs from the mode (fallback, budget, thermal, ...). */
|
|
14
|
+
reason?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class GravixNoiseSuppression {
|
|
17
|
+
static readonly instance: GravixNoiseSuppression;
|
|
18
|
+
private last;
|
|
19
|
+
private mode;
|
|
20
|
+
private options;
|
|
21
|
+
private facts;
|
|
22
|
+
/** Studio benchmark of this process (the native side keeps no cache). */
|
|
23
|
+
private bench;
|
|
24
|
+
private benchRunning;
|
|
25
|
+
private resolvedReason;
|
|
26
|
+
private constructor();
|
|
27
|
+
/**
|
|
28
|
+
* Android: resolved like Flutter / web (`resolveNs`, background studio
|
|
29
|
+
* benchmark for `auto`), then run natively on WebRTC's capture
|
|
30
|
+
* post-processing slot. Capture the mic with WebRTC's own
|
|
31
|
+
* `noiseSuppression` / `autoGainControl` off while the engine is ours.
|
|
32
|
+
*
|
|
33
|
+
* iOS: resolves the engine with gravix-rtc's `resolveNs` (device facts from
|
|
34
|
+
* native, the studio benchmark run natively when `auto` needs it) and
|
|
35
|
+
* configures the native chain. WebRTC's own software NS / AGC are NOT
|
|
36
|
+
* switched off here: publish the mic with `noiseSuppression: false,
|
|
37
|
+
* autoGainControl: false` while ours runs (see {@link webrtcProcessingFor}).
|
|
38
|
+
*/
|
|
39
|
+
setMode(mode: GravixNoiseSuppressionMode, options?: Partial<GravixNoiseSuppressionOptions>): Promise<GravixNoiseSuppressionState>;
|
|
40
|
+
getState(): Promise<GravixNoiseSuppressionState>;
|
|
41
|
+
/**
|
|
42
|
+
* The WebRTC capture processing to publish the mic with while Gravix NS
|
|
43
|
+
* runs (Flutter `gravixNsProcessing`): software NS off when
|
|
44
|
+
* `disableWebRtcNs`, AGC off unless `agcOrder: webrtcBeforeNs`.
|
|
45
|
+
*/
|
|
46
|
+
webrtcProcessingFor(engine: GravixNoiseSuppressionState['engine']): {
|
|
47
|
+
noiseSuppression?: boolean;
|
|
48
|
+
autoGainControl?: boolean;
|
|
49
|
+
};
|
|
50
|
+
private stateFrom;
|
|
51
|
+
private benchKey;
|
|
52
|
+
private apply;
|
|
53
|
+
/** auto: the studio benchmark off the audio path, then re-resolve. */
|
|
54
|
+
private runBenchmark;
|
|
55
|
+
/**
|
|
56
|
+
* iOS native events (`engineChanged`, `benchmark`, `routeReset`,
|
|
57
|
+
* `musicBypass`, `musicDetected`, `singerMode`, `download`), the Flutter
|
|
58
|
+
* `onNsEvent` maps. Returns the unsubscribe function.
|
|
59
|
+
*/
|
|
60
|
+
onNativeEvent(fn: (event: Record<string, unknown>) => void): () => void;
|
|
61
|
+
private setModeAndroid;
|
|
62
|
+
private getStateAndroid;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=noiseSuppression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noiseSuppression.d.ts","sourceRoot":"","sources":["../../../../src/features/noiseSuppression.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAGnC,MAAM,YAAY,CAAC;AAgBpB;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,gCAAgC;IAChC,MAAM,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC9C,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAqBD,qBAAa,sBAAsB;IACjC,MAAM,CAAC,QAAQ,CAAC,QAAQ,yBAAgC;IAExD,OAAO,CAAC,IAAI,CAA4C;IACxD,OAAO,CAAC,IAAI,CAAqC;IACjD,OAAO,CAAC,OAAO,CAA4D;IAC3E,OAAO,CAAC,KAAK,CAA2B;IACxC,yEAAyE;IACzE,OAAO,CAAC,KAAK,CAAkC;IAC/C,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,cAAc,CAAc;IAEpC,OAAO;IAEP;;;;;;;;;;;OAWG;IACG,OAAO,CACX,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,GAC/C,OAAO,CAAC,2BAA2B,CAAC;IAiBjC,QAAQ,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAQtD;;;;OAIG;IACH,mBAAmB,CAAC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,GAAG;QAClE,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B;IAUD,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,QAAQ;YAWF,KAAK;IAyCnB,sEAAsE;YACxD,YAAY;IAoB1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI;YAKzD,cAAc;YAgBd,eAAe;CAW9B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Room } from 'gravix-rtc';
|
|
2
|
+
import { type GravixMusicOptions, type GravixMusicSource, type GravixMusicStartOptions, type GravixMusicState } from './roomMusicTypes.js';
|
|
3
|
+
export * from './roomMusicTypes.js';
|
|
4
|
+
/**
|
|
5
|
+
* Room music / karaoke: a local audio file mixed into the published
|
|
6
|
+
* microphone (Flutter `GravixRoomMusic`). The work is done per platform:
|
|
7
|
+
* Android in `roomMusicAndroid.ts` (docs/ANDROID_NATIVE_HOOKS.md), iOS in
|
|
8
|
+
* `roomMusicIos.ts` (docs/IOS_NATIVE_HOOKS.md). Where the platform has no
|
|
9
|
+
* native music, every call throws `GravixUnsupportedError`.
|
|
10
|
+
*/
|
|
11
|
+
export declare class GravixRoomMusic {
|
|
12
|
+
readonly options: Readonly<Required<GravixMusicOptions>>;
|
|
13
|
+
private readonly impl;
|
|
14
|
+
constructor(options?: GravixMusicOptions);
|
|
15
|
+
get state(): GravixMusicState;
|
|
16
|
+
/** Binds the controller to a connected room (the published mic carries the mix). */
|
|
17
|
+
attach(room: Room): void;
|
|
18
|
+
/** Decodes ahead so `start` begins without a gap. */
|
|
19
|
+
prepare(source: GravixMusicSource): Promise<void>;
|
|
20
|
+
start(source: GravixMusicSource, options?: GravixMusicStartOptions): Promise<void>;
|
|
21
|
+
pause(): Promise<void>;
|
|
22
|
+
resume(): Promise<void>;
|
|
23
|
+
stop(): Promise<void>;
|
|
24
|
+
seek(positionMs: number): Promise<void>;
|
|
25
|
+
setMusicVolume(volume: number): Promise<void>;
|
|
26
|
+
setMicVolume(volume: number): Promise<void>;
|
|
27
|
+
setDucking(on: boolean): Promise<void>;
|
|
28
|
+
setLoop(on: boolean): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Mutes the singer's voice. Android: with music playing this is a
|
|
31
|
+
* voice-only mute (the song keeps going out; the recorder is released when
|
|
32
|
+
* `continueWhileMicReleased`). iOS: a plain mic mute.
|
|
33
|
+
*/
|
|
34
|
+
setMicMuted(muted: boolean): Promise<void>;
|
|
35
|
+
/** The singer's song position now, extrapolated from the last native stamp. */
|
|
36
|
+
positionNow(): number;
|
|
37
|
+
/** A listener's view of a singer's position (lyric sync over `gx.music`). */
|
|
38
|
+
remotePositionNow(participantIdentity: string): number | undefined;
|
|
39
|
+
dispose(): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
//#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OAAO,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAGnC;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAM1C,+EAA+E;IAC/E,WAAW,IAAI,MAAM;IAGrB,6EAA6E;IAC7E,iBAAiB,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAGlE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAGzB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type Room } from 'gravix-rtc';
|
|
2
|
+
import { type GravixMusicSource, type GravixMusicOptions, type GravixMusicState, type GravixMusicStartOptions } from './roomMusicTypes.js';
|
|
3
|
+
/**
|
|
4
|
+
* Android: the song is decoded natively and mixed into the published mic
|
|
5
|
+
* (one stream, `MusicMixerEngine`), with monitor, mic volume, ducking, loop,
|
|
6
|
+
* seek and the 0.12.2 mute rules. Not ported yet on React Native:
|
|
7
|
+
* `asset` sources (copy the file out and use `file`), the lyric-sync
|
|
8
|
+
* `gx.music` messages (`syncPosition`, `remotePositionNow` stays undefined),
|
|
9
|
+
* `musicMaxBitrate` / `disableDtxWhileMusic` (use the core's publish options).
|
|
10
|
+
*/
|
|
11
|
+
export declare class AndroidRoomMusic {
|
|
12
|
+
readonly options: Readonly<Required<GravixMusicOptions>>;
|
|
13
|
+
private room;
|
|
14
|
+
private native;
|
|
15
|
+
private current;
|
|
16
|
+
private stampAt;
|
|
17
|
+
private unlisten;
|
|
18
|
+
constructor(options?: GravixMusicOptions);
|
|
19
|
+
get state(): GravixMusicState;
|
|
20
|
+
private android;
|
|
21
|
+
private set;
|
|
22
|
+
private run;
|
|
23
|
+
/** The published mic track (null before it is published). */
|
|
24
|
+
private micTrack;
|
|
25
|
+
private relaxed;
|
|
26
|
+
/**
|
|
27
|
+
* WebRTC NS / AGC / HPF relaxed while the song plays (Flutter relaxVoiceProcessing).
|
|
28
|
+
* Given back to WebRTC's defaults only while neither Gravix NS nor the singer
|
|
29
|
+
* capture is on (both want WebRTC's NS / AGC off).
|
|
30
|
+
*/
|
|
31
|
+
private relax;
|
|
32
|
+
private micAfterMusic;
|
|
33
|
+
/** Binds the controller to a connected room (the published mic carries the mix). */
|
|
34
|
+
attach(room: Room): void;
|
|
35
|
+
/** Checks the source; the native decoder opens it on `start`. */
|
|
36
|
+
prepare(source: GravixMusicSource): Promise<void>;
|
|
37
|
+
start(source: GravixMusicSource, options?: GravixMusicStartOptions): Promise<void>;
|
|
38
|
+
pause(): Promise<void>;
|
|
39
|
+
resume(): Promise<void>;
|
|
40
|
+
stop(): Promise<void>;
|
|
41
|
+
seek(positionMs: number): Promise<void>;
|
|
42
|
+
setMusicVolume(volume: number): Promise<void>;
|
|
43
|
+
setMicVolume(volume: number): Promise<void>;
|
|
44
|
+
setDucking(on: boolean): Promise<void>;
|
|
45
|
+
setLoop(on: boolean): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Android: mutes / unmutes the mic while the song plays with the 0.12.2
|
|
48
|
+
* rules: `continueWhileMicMuted` keeps the song going out (voice zeroed,
|
|
49
|
+
* the publication stays live); with `GravixMicRelease.setMuteReleasesMic(true)`
|
|
50
|
+
* and `continueWhileMicReleased` the recorder is released too (OS mic
|
|
51
|
+
* indicator off). Without music, or with those off, it is a plain track mute.
|
|
52
|
+
*/
|
|
53
|
+
setMicMuted(muted: boolean): Promise<void>;
|
|
54
|
+
/** The singer's song position now, extrapolated from the last native stamp. */
|
|
55
|
+
positionNow(): number;
|
|
56
|
+
/** A listener's view of a singer's position (lyric sync over `gx.music`; not on React Native yet). */
|
|
57
|
+
remotePositionNow(_participantIdentity: string): number | undefined;
|
|
58
|
+
dispose(): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=roomMusicAndroid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roomMusicAndroid.d.ts","sourceRoot":"","sources":["../../../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CAAC,IAAI,CAAC;IAG7C,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAG3C,UAAU,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAGtC,OAAO,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAGnC;;;;;;OAMG;IACG,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBhD,+EAA+E;IAC/E,WAAW,IAAI,MAAM;IAOrB,sGAAsG;IACtG,iBAAiB,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI7D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAU/B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Room } from 'gravix-rtc';
|
|
2
|
+
import { type GravixMusicSource, type GravixMusicOptions, type GravixMusicState, type GravixMusicStartOptions } from './roomMusicTypes.js';
|
|
3
|
+
/**
|
|
4
|
+
* iOS: the song is mixed natively after noise suppression and the voice
|
|
5
|
+
* effect (Flutter 0.12 post-effect route). A mute that releases the mic also
|
|
6
|
+
* silences the song for listeners and holds its position (iOS has no
|
|
7
|
+
* voice-only mute). Lyric sync (`gx.music`) is not part of the iOS native
|
|
8
|
+
* port; see docs/IOS_NATIVE_HOOKS.md.
|
|
9
|
+
*
|
|
10
|
+
* iOS applies musicVolume, micVolume, ducking, duckLevel, loop, monitor and
|
|
11
|
+
* postEffectMix. musicMaxBitrate / disableDtxWhileMusic / relaxVoiceProcessing
|
|
12
|
+
* go through gravix-rtc's `room.setSingerMode(true, ...)` while the song
|
|
13
|
+
* plays (needs {@link IosRoomMusic.attach}; an app-owned singer mode is left
|
|
14
|
+
* alone) and are undone when it stops. Not applied on iOS:
|
|
15
|
+
* pauseOnInterruption, continueWhileMicMuted, continueWhileMicReleased,
|
|
16
|
+
* syncPosition.
|
|
17
|
+
*/
|
|
18
|
+
export declare class IosRoomMusic {
|
|
19
|
+
readonly options: Readonly<Required<GravixMusicOptions>>;
|
|
20
|
+
private st;
|
|
21
|
+
private sampledAt;
|
|
22
|
+
/** Age of the native position stamp at the last reading (ms). */
|
|
23
|
+
private readingAgeMs;
|
|
24
|
+
private timer;
|
|
25
|
+
private offCompleted;
|
|
26
|
+
private room;
|
|
27
|
+
/** Singer mode was turned on by this controller (undo on stop). */
|
|
28
|
+
private singerOurs;
|
|
29
|
+
constructor(options?: GravixMusicOptions);
|
|
30
|
+
get state(): GravixMusicState;
|
|
31
|
+
/** Binds the controller to a connected room (the published mic carries the mix). */
|
|
32
|
+
attach(room: Room): void;
|
|
33
|
+
/** Decodes ahead so `start` begins without a gap. */
|
|
34
|
+
prepare(source: GravixMusicSource): Promise<void>;
|
|
35
|
+
start(source: GravixMusicSource, options?: GravixMusicStartOptions): Promise<void>;
|
|
36
|
+
pause(): Promise<void>;
|
|
37
|
+
resume(): Promise<void>;
|
|
38
|
+
stop(): Promise<void>;
|
|
39
|
+
/** Music bitrate / DTX / processing for the song (Flutter music session). */
|
|
40
|
+
private singerOn;
|
|
41
|
+
private singerOff;
|
|
42
|
+
seek(positionMs: number): Promise<void>;
|
|
43
|
+
setMusicVolume(volume: number): Promise<void>;
|
|
44
|
+
setMicVolume(volume: number): Promise<void>;
|
|
45
|
+
setDucking(on: boolean): Promise<void>;
|
|
46
|
+
setLoop(on: boolean): Promise<void>;
|
|
47
|
+
/** The singer's song position now, extrapolated from the last native stamp. */
|
|
48
|
+
positionNow(): number;
|
|
49
|
+
/** A listener's view of a singer's position (lyric sync over `gx.music`). */
|
|
50
|
+
remotePositionNow(_participantIdentity: string): number | undefined;
|
|
51
|
+
dispose(): Promise<void>;
|
|
52
|
+
private watch;
|
|
53
|
+
private idle;
|
|
54
|
+
private refresh;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=roomMusicIos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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AG,OAAO,CAAC,IAAI,CAAC;IAK7C,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3C,UAAU,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAQtC,OAAO,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzC,+EAA+E;IAC/E,WAAW,IAAI,MAAM;IAerB,6EAA6E;IAC7E,iBAAiB,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAG7D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAW9B,OAAO,CAAC,KAAK;IAab,OAAO,CAAC,IAAI;YASE,OAAO;CAmBtB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Room music / karaoke: a local audio file mixed into the published
|
|
3
|
+
* microphone (Flutter `GravixRoomMusic`). Native-only: until the platform
|
|
4
|
+
* implements it, every call throws `GravixUnsupportedError`.
|
|
5
|
+
*/
|
|
6
|
+
/** Where the song comes from (Flutter `GravixMusicSource`). */
|
|
7
|
+
export type GravixMusicSource = {
|
|
8
|
+
kind: 'file';
|
|
9
|
+
path: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'contentUri';
|
|
12
|
+
uri: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'asset';
|
|
15
|
+
key: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const GravixMusicSource: {
|
|
18
|
+
file: (path: string) => GravixMusicSource;
|
|
19
|
+
/** Android `content://` uri (e.g. from a document picker). */
|
|
20
|
+
contentUri: (uri: string) => GravixMusicSource;
|
|
21
|
+
/** A file bundled with the app. */
|
|
22
|
+
asset: (key: string) => GravixMusicSource;
|
|
23
|
+
};
|
|
24
|
+
/** Same fields and defaults as Flutter `GravixMusicOptions` (0.12.2). */
|
|
25
|
+
export interface GravixMusicOptions {
|
|
26
|
+
/** Song level in the mix, 0..1. Default 1. */
|
|
27
|
+
musicVolume?: number;
|
|
28
|
+
/** Voice level in the mix, 0..1. Default 1. */
|
|
29
|
+
micVolume?: number;
|
|
30
|
+
/** Lower the song while the singer talks. Default false. */
|
|
31
|
+
ducking?: boolean;
|
|
32
|
+
/** Song level while ducked, 0..1. Default 0.35. */
|
|
33
|
+
duckLevel?: number;
|
|
34
|
+
loop?: boolean;
|
|
35
|
+
/** The singer hears the song locally. Default true. */
|
|
36
|
+
monitor?: boolean;
|
|
37
|
+
/** Mic bitrate while music plays, bps. Default 96000. */
|
|
38
|
+
musicMaxBitrate?: number;
|
|
39
|
+
/** The song keeps going out while the mic is muted. Default true. */
|
|
40
|
+
continueWhileMicMuted?: boolean;
|
|
41
|
+
/** The song keeps going out while mute has released the mic (0.12.2, Android). Default true. */
|
|
42
|
+
continueWhileMicReleased?: boolean;
|
|
43
|
+
pauseOnInterruption?: boolean;
|
|
44
|
+
disableDtxWhileMusic?: boolean;
|
|
45
|
+
relaxVoiceProcessing?: boolean;
|
|
46
|
+
/** Mix after the voice effect so the effect stays on while the song plays. Default true. */
|
|
47
|
+
postEffectMix?: boolean;
|
|
48
|
+
/** Send `gx.music` position messages so listeners can sync lyrics. Default true. */
|
|
49
|
+
syncPosition?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export declare const DEFAULT_MUSIC_OPTIONS: Readonly<Required<GravixMusicOptions>>;
|
|
52
|
+
export type GravixMusicStatus = 'idle' | 'loading' | 'playing' | 'paused' | 'error';
|
|
53
|
+
export interface GravixMusicState {
|
|
54
|
+
status: GravixMusicStatus;
|
|
55
|
+
source?: GravixMusicSource;
|
|
56
|
+
positionMs: number;
|
|
57
|
+
durationMs?: number;
|
|
58
|
+
title?: string;
|
|
59
|
+
error?: string;
|
|
60
|
+
}
|
|
61
|
+
/** A singer position sample (Flutter `GravixMusicPosition`). */
|
|
62
|
+
export interface GravixMusicPosition {
|
|
63
|
+
positionMs: number;
|
|
64
|
+
sampledAt: number;
|
|
65
|
+
playing: boolean;
|
|
66
|
+
durationMs?: number;
|
|
67
|
+
}
|
|
68
|
+
/** Data topic of the listener lyric-sync messages (Flutter `kGravixMusicSyncTopic`). */
|
|
69
|
+
export declare const GRAVIX_MUSIC_SYNC_TOPIC = "gx.music";
|
|
70
|
+
export interface GravixMusicStartOptions {
|
|
71
|
+
loop?: boolean;
|
|
72
|
+
volume?: number;
|
|
73
|
+
trackId?: string;
|
|
74
|
+
title?: string;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=roomMusicTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roomMusicTypes.d.ts","sourceRoot":"","sources":["../../../../src/features/roomMusicTypes.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,+DAA+D;AAC/D,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,eAAO,MAAM,iBAAiB;iBACf,MAAM,KAAG,iBAAiB;IACvC,8DAA8D;sBAC5C,MAAM,KAAG,iBAAiB;IAC5C,mCAAmC;iBACtB,MAAM,KAAG,iBAAiB;CACxC,CAAC;AAEF,yEAAyE;AACzE,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yDAAyD;IAC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+
/**
|
|
2
|
+
* Screen share needs a foreground service (Android MediaProjection) or a
|
|
3
|
+
* broadcast upload extension (iOS). react-native-webrtc has the
|
|
4
|
+
* capture parts; the Gravix wiring (service, extension, app-group setup) is
|
|
5
|
+
* not done yet. `localParticipant.setScreenShareEnabled` may work on Android
|
|
6
|
+
* when the app declares the media-projection service itself.
|
|
7
|
+
*/
|
|
8
|
+
export declare const GravixScreenShare: {
|
|
9
|
+
start(): Promise<void>;
|
|
10
|
+
stop(): Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=screenShare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenShare.d.ts","sourceRoot":"","sources":["../../../../src/features/screenShare.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;aACnB,OAAO,CAAC,IAAI,CAAC;YAGd,OAAO,CAAC,IAAI,CAAC;CAGtB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Singer mode, native half. The publish half (processing off, DTX off,
|
|
3
|
+
* 96 kbps) is gravix-rtc's `room.setSingerMode(on, options)` and works in React
|
|
4
|
+
* Native today. What needs native code is the recorder source switch and the
|
|
5
|
+
* level normaliser (Flutter `GravixSingerCaptureSource`, `GxSingerSource.kt`).
|
|
6
|
+
*
|
|
7
|
+
* iOS (as in Flutter): there is no recorder source switch (the voice
|
|
8
|
+
* processing unit belongs to the audio session); singer mode bypasses the
|
|
9
|
+
* Gravix noise suppression chain instead. Any source other than `keep`
|
|
10
|
+
* turns that bypass on, `keep` turns it off. The level normaliser is Android
|
|
11
|
+
* only.
|
|
12
|
+
*/
|
|
13
|
+
export type GravixSingerCaptureSource = 'keep' | 'mic' | 'voiceRecognition' | 'unprocessed';
|
|
14
|
+
export declare const GravixSingerCapture: {
|
|
15
|
+
/** Switches the Android/iOS recorder source while singer mode is on. */
|
|
16
|
+
setCaptureSource(source: GravixSingerCaptureSource): Promise<void>;
|
|
17
|
+
/** Singer level normaliser (makeup gain, pause guard) in the capture chain. Android only. */
|
|
18
|
+
setLevelNormaliser(on: boolean): Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=singerMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singerMode.d.ts","sourceRoot":"","sources":["../../../../src/features/singerMode.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,yBAAyB,GACnC,MAAM,GAAG,KAAK,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAuBtD,eAAO,MAAM,mBAAmB;IAC9B,wEAAwE;6BACzC,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxE,6FAA6F;2BACtE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAY/C,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice effects applied to the published microphone (Flutter
|
|
3
|
+
* `GravixVoiceEffect`, 35 effects + `none`). Native-only: until the platform
|
|
4
|
+
* implements it, {@link GravixVoiceEffects.set} throws `GravixUnsupportedError`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const GRAVIX_VOICE_EFFECTS: readonly ["none", "studio", "hall", "robot", "girl", "transformer", "boy", "child", "woman", "man", "foreigner", "ethereal", "magnetic", "fresh", "energetic", "rich", "muffled", "round", "falsetto", "full", "clear", "resonant", "loudClear", "softRoom", "largeRoom", "valley", "basement", "ktv", "enhancedKtv", "popular", "rock", "vocalConcert", "gramophone", "autotuneMajorC", "autotuneMinorA", "autotuneHarmonicMinor"];
|
|
7
|
+
export type GravixVoiceEffect = (typeof GRAVIX_VOICE_EFFECTS)[number];
|
|
8
|
+
/** Why the active effect differs from the requested one (Flutter `GravixVoiceEffectReason`). */
|
|
9
|
+
export type GravixVoiceEffectReason = 'ok' | 'platformUnsupported' | 'libraryMissing' | 'watchdog' | 'failed';
|
|
10
|
+
export interface GravixVoiceEffectState {
|
|
11
|
+
/** The requested effect. */
|
|
12
|
+
effect: GravixVoiceEffect;
|
|
13
|
+
/** The effect actually running in the capture chain. */
|
|
14
|
+
active: GravixVoiceEffect;
|
|
15
|
+
reason: GravixVoiceEffectReason;
|
|
16
|
+
/** True while room music bypasses the effect. */
|
|
17
|
+
musicBypass: boolean;
|
|
18
|
+
/** Added capture latency, ms. */
|
|
19
|
+
latencyMs: number;
|
|
20
|
+
}
|
|
21
|
+
export interface GravixVoiceEffectBenchmark {
|
|
22
|
+
effect: GravixVoiceEffect;
|
|
23
|
+
p50Us: number;
|
|
24
|
+
p95Us: number;
|
|
25
|
+
maxUs: number;
|
|
26
|
+
latencyMs: number;
|
|
27
|
+
}
|
|
28
|
+
export declare function isGravixVoiceEffect(v: unknown): v is GravixVoiceEffect;
|
|
29
|
+
/** Singleton like Flutter's `GravixVoiceEffects.instance`. */
|
|
30
|
+
export declare class GravixVoiceEffects {
|
|
31
|
+
static readonly instance: GravixVoiceEffects;
|
|
32
|
+
private current;
|
|
33
|
+
private listening;
|
|
34
|
+
private constructor();
|
|
35
|
+
/** The last known state. */
|
|
36
|
+
get state(): GravixVoiceEffectState;
|
|
37
|
+
private apply;
|
|
38
|
+
private listen;
|
|
39
|
+
/** Selects an effect for the published mic; resolves true when the native chain took it. */
|
|
40
|
+
set(effect: GravixVoiceEffect): Promise<boolean>;
|
|
41
|
+
/** Re-reads the native state. */
|
|
42
|
+
refresh(): Promise<GravixVoiceEffectState>;
|
|
43
|
+
/** Measures one effect's processing cost on this device (Flutter default: 5 s). */
|
|
44
|
+
benchmark(effect: GravixVoiceEffect, seconds?: number): Promise<GravixVoiceEffectBenchmark>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=voiceEffects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voiceEffects.d.ts","sourceRoot":"","sources":["../../../../src/features/voiceEffects.ts"],"names":[],"mappings":"AAgBA;;;;G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,SAAI,GACV,OAAO,CAAC,0BAA0B,CAAC;CA0BvC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Room } from 'gravix-rtc';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
/** Makes `room` the default for every hook below it. */
|
|
4
|
+
export declare function GravixRoomProvider({ room, children, }: {
|
|
5
|
+
room: Room;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
/** The room from `GravixRoomProvider`, or undefined. */
|
|
9
|
+
export declare function useRoomContext(): Room | undefined;
|
|
10
|
+
/** `room` if given, else the provider's; throws when there is neither. */
|
|
11
|
+
export declare function useEnsureRoom(room?: Room): Room;
|
|
12
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/hooks/context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAIlE,wDAAwD;AACxD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,+BAMA;AAED,wDAAwD;AACxD,wBAAgB,cAAc,IAAI,IAAI,GAAG,SAAS,CAEjD;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAS/C"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ConnectionQuality, ConnectionState, type LocalParticipant, type Participant, type RemoteParticipant, type Room, Track } from 'gravix-rtc';
|
|
2
|
+
import type { TrackReference } from './types.js';
|
|
3
|
+
/** The room's connection state. */
|
|
4
|
+
export declare function useConnectionState(room?: Room): ConnectionState;
|
|
5
|
+
/** Remote participants, in join order. */
|
|
6
|
+
export declare function useRemoteParticipants(room?: Room): RemoteParticipant[];
|
|
7
|
+
/** The local participant first, then the remote ones. */
|
|
8
|
+
export declare function useParticipants(room?: Room): Participant[];
|
|
9
|
+
/** The local participant (re-renders on its mic/camera changes). */
|
|
10
|
+
export declare function useLocalParticipant(room?: Room): LocalParticipant;
|
|
11
|
+
/**
|
|
12
|
+
* The local mic is muted: the core mute OR an Android voice-only music mute
|
|
13
|
+
* (`GravixRoomMusic.setMicMuted`), which leaves `track.isMuted` false. Use it
|
|
14
|
+
* for the mic button instead of `isMicrophoneEnabled`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useMicMuted(room?: Room): boolean;
|
|
17
|
+
/** Participants speaking now, loudest first (server `ActiveSpeakersChanged`). */
|
|
18
|
+
export declare function useActiveSpeakers(room?: Room): Participant[];
|
|
19
|
+
export interface UseTracksOptions {
|
|
20
|
+
/** Default: camera, microphone, screen share. */
|
|
21
|
+
sources?: Track.Source[];
|
|
22
|
+
/** Only remote tracks that are subscribed (local ones are always included). Default false. */
|
|
23
|
+
onlySubscribed?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Track references of every participant, filtered by source. */
|
|
26
|
+
export declare function useTracks(options?: UseTracksOptions, room?: Room): TrackReference[];
|
|
27
|
+
/** @internal exported for tests */
|
|
28
|
+
export declare function collectTracks(room: Room, sources: Track.Source[], onlySubscribed: boolean): TrackReference[];
|
|
29
|
+
export interface ParticipantState {
|
|
30
|
+
identity: string;
|
|
31
|
+
name: string | undefined;
|
|
32
|
+
metadata: string | undefined;
|
|
33
|
+
isSpeaking: boolean;
|
|
34
|
+
audioLevel: number;
|
|
35
|
+
isMicrophoneEnabled: boolean;
|
|
36
|
+
isCameraEnabled: boolean;
|
|
37
|
+
isScreenShareEnabled: boolean;
|
|
38
|
+
connectionQuality: ConnectionQuality;
|
|
39
|
+
cameraTrack: TrackReference | undefined;
|
|
40
|
+
microphoneTrack: TrackReference | undefined;
|
|
41
|
+
}
|
|
42
|
+
/** One participant's speaking/mic/camera/quality state (Flutter `onUserMuteAudio` & co). */
|
|
43
|
+
export declare function useParticipant(participant: Participant): ParticipantState;
|
|
44
|
+
export interface UseRoomResult {
|
|
45
|
+
room: Room;
|
|
46
|
+
connectionState: ConnectionState;
|
|
47
|
+
isConnected: boolean;
|
|
48
|
+
participants: Participant[];
|
|
49
|
+
activeSpeakers: Participant[];
|
|
50
|
+
tracks: TrackReference[];
|
|
51
|
+
}
|
|
52
|
+
/** Everything a simple room screen needs, in one hook. */
|
|
53
|
+
export declare function useRoom(room?: Room, options?: UseTracksOptions): UseRoomResult;
|
|
54
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../src/hooks/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAEhB,KAAK,iBAAiB,EACtB,KAAK,IAAI,EAET,KAAK,EACN,MAAM,YAAY,CAAC;AAIpB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAS,CAAC;AA2B9C,mCAAmC;AACnC,wBAAgB,kBAAkB,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,eAAe,CAI/D;AAED,0CAA0C;AAC1C,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,iBAAiB,EAAE,CAKtE;AAED,yDAAyD;AACzD,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,WAAW,EAAE,CAO1D;AAED,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,gBAAgB,CAUjE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAYhD;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,IAAI,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B,OAAO,CACrB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,gBAAgB,GACzB,aAAa,CAcf"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Participant, Track, TrackPublication } from 'gravix-rtc';
|
|
2
|
+
/** A participant's track slot (published or not yet subscribed). */
|
|
3
|
+
export interface TrackReference {
|
|
4
|
+
participant: Participant;
|
|
5
|
+
publication: TrackPublication;
|
|
6
|
+
source: Track.Source;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEvE,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,gBAAgB,CAAC;IAC9B,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Room, RoomEvent } from 'gravix-rtc';
|
|
2
|
+
/**
|
|
3
|
+
* Re-renders when `room` emits any of `events`. The hooks derive their values
|
|
4
|
+
* from the room on each render, so there is no copied state to go stale.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
/** @internal */
|
|
8
|
+
export type Emitter = {
|
|
9
|
+
on(event: string, handler: () => void): unknown;
|
|
10
|
+
off(event: string, handler: () => void): unknown;
|
|
11
|
+
};
|
|
12
|
+
export declare function useRoomEvents(room: Room, events: readonly RoomEvent[]): number;
|
|
13
|
+
//# sourceMappingURL=useRoomEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRoomEvents.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useRoomEvents.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGlD;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;IAChD,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;CAClD,CAAC;AAEF,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,MAAM,CAeR"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gravix-rtc-react-native: Gravix Cloud real-time voice/video for React Native
|
|
3
|
+
* (Android + iOS).
|
|
4
|
+
*
|
|
5
|
+
* Single import surface, like the Flutter `gravix_rtc` package: the full
|
|
6
|
+
* gravix-rtc core (Room, tracks, events, GravixJoin, GravixTokenProvider,
|
|
7
|
+
* createToken, region probe, ...) is re-exported from here, next to the React
|
|
8
|
+
* Native parts (registerGlobals, AudioSession, VideoView, hooks) and the
|
|
9
|
+
* typed native-feature APIs.
|
|
10
|
+
*
|
|
11
|
+
* Call `registerGlobals()` once at startup, before creating a Room.
|
|
12
|
+
*/
|
|
13
|
+
import './polyfills/early.js';
|
|
14
|
+
export * from 'gravix-rtc';
|
|
15
|
+
import './ios/autoAttach.js';
|
|
16
|
+
export { registerGlobals, type RegisterGlobalsOptions, type GravixReactNativeGlobal, } from './registerGlobals.js';
|
|
17
|
+
export { default as AudioSession, AndroidAudioTypePresets, type AndroidAudioTypeOptions, type AndroidAudioOutput, type AudioConfiguration, type AudioOutputId, type AppleAudioCategory, type AppleAudioCategoryOption, type AppleAudioConfiguration, type AppleAudioMode, } from './audio/AudioSession.js';
|
|
18
|
+
export { setupIOSAudioManagement, getDefaultAppleAudioConfigurationForAudioState, type AudioEngineConfigurationState, type IOSAudioSessionPolicy, } from './audio/AudioManager.js';
|
|
19
|
+
export { VideoView, type VideoViewProps } from './components/VideoView.js';
|
|
20
|
+
export { GravixRoomProvider, useRoomContext } from './hooks/context.js';
|
|
21
|
+
export { useActiveSpeakers, useConnectionState, useLocalParticipant, useMicMuted, useParticipant, useParticipants, useRemoteParticipants, useRoom, useTracks, type ParticipantState, type UseRoomResult, type UseTracksOptions, } from './hooks/hooks.js';
|
|
22
|
+
export type { TrackReference } from './hooks/types.js';
|
|
23
|
+
export { gravixAppStateLifecycle, createGravixJoin, } from './join/appStateLifecycle.js';
|
|
24
|
+
export { NATIVE_FEATURES, GravixUnsupportedError, getCapabilities, isFeatureSupported, type GravixCapabilities, type GravixNativeFeature, } from './unsupported.js';
|
|
25
|
+
export { GRAVIX_VOICE_EFFECTS, GravixVoiceEffects, isGravixVoiceEffect, type GravixVoiceEffect, type GravixVoiceEffectBenchmark, type GravixVoiceEffectReason, type GravixVoiceEffectState, } from './features/voiceEffects.js';
|
|
26
|
+
export { DEFAULT_MUSIC_OPTIONS, GRAVIX_MUSIC_SYNC_TOPIC, GravixMusicSource, GravixRoomMusic, type GravixMusicOptions, type GravixMusicPosition, type GravixMusicStartOptions, type GravixMusicState, type GravixMusicStatus, } from './features/roomMusic.js';
|
|
27
|
+
export { GravixNoiseSuppression, type GravixNoiseSuppressionState, } from './features/noiseSuppression.js';
|
|
28
|
+
export { GravixSingerCapture, type GravixSingerCaptureSource, } from './features/singerMode.js';
|
|
29
|
+
export { GravixMicRelease, type GravixRecorderState, } from './features/micRelease.js';
|
|
30
|
+
export { gravixUseAudioScenario, type GravixAudioScenario, } from './features/audioScenario.js';
|
|
31
|
+
export { GravixScreenShare } from './features/screenShare.js';
|
|
32
|
+
export { GravixBeautyEffect, GravixRoomCamera, GRAVIX_CAMERA_PUBLISH_OPTIONS, gravixEffects, type GravixBeautyEffectOptions, type GravixCameraEffect, type GravixCameraOpenOptions, type GravixCameraPosition, type GravixEffectsCameraLike, type GravixEffectsModuleLike, type GravixEffectsOutputLike, type GravixPackAvailabilityLike, type GravixRoomCameraOptions, type GravixRoomCameraState, type GravixVideoEffect, type GravixVideoEffectTarget, } from './features/beauty.js';
|
|
33
|
+
export { GRAVIX_RTC_RN_VERSION } from './version.js';
|
|
34
|
+
/** Android native audio, low level (Flutter channel methods); the feature classes above use it. */
|
|
35
|
+
import * as GravixAndroidAudio from './android/index.js';
|
|
36
|
+
export { GravixAndroidAudio };
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,sBAAmB,CAAC;AAE3B,cAAc,YAAY,CAAC;AAG3B,OAAO,qBAAkB,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,sBAAmB,CAAC;AAC3B,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,cAAc,GACpB,MAAM,yBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,8CAA8C,EAC9C,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,GAC3B,MAAM,yBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,2BAAwB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAiB,CAAC;AACrE,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,OAAO,EACP,SAAS,EACT,KAAK,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