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.
Files changed (378) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/LICENSE +20 -0
  3. package/LICENSES/Apache-2.0.txt +175 -0
  4. package/NOTICE +68 -0
  5. package/README.md +313 -2
  6. package/android/build.gradle +137 -0
  7. package/android/consumer-rules.pro +29 -0
  8. package/android/src/main/AndroidManifest.xml +9 -0
  9. package/android/src/main/cpp/CMakeLists.txt +48 -0
  10. package/android/src/main/cpp/gx_dfn_engine.c +332 -0
  11. package/android/src/main/cpp/gx_fx_jni.cpp +34 -0
  12. package/android/src/main/cpp/gx_ns_jni.c +162 -0
  13. package/android/src/main/cpp/third_party/onnxruntime/LICENSE +21 -0
  14. package/android/src/main/cpp/third_party/onnxruntime/include/onnxruntime_c_api.h +9227 -0
  15. package/android/src/main/cpp/third_party/onnxruntime/include/onnxruntime_ep_c_api.h +3315 -0
  16. package/android/src/main/cpp/third_party/onnxruntime/include/onnxruntime_error_code.h +98 -0
  17. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixAudioHooks.kt +144 -0
  18. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixAudioModule.kt +105 -0
  19. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixNativeAudio.kt +310 -0
  20. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixRtc.kt +134 -0
  21. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixRtcModule.kt +176 -0
  22. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixRtcPackage.kt +39 -0
  23. package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioDeviceKind.java +44 -0
  24. package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioManagerUtils.kt +120 -0
  25. package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioSwitchManager.java +270 -0
  26. package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioType.kt +50 -0
  27. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicCaptureRouter.kt +375 -0
  28. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicDecoder.kt +339 -0
  29. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicInterruptionWatcher.kt +82 -0
  30. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicMicRelease.kt +117 -0
  31. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicMixKernel.kt +191 -0
  32. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicMixerEngine.kt +617 -0
  33. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/AudioRoutePolicy.kt +137 -0
  34. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GravixCaptureProcessing.kt +67 -0
  35. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxCaptureDump.kt +143 -0
  36. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxCaptureSwitcher.kt +196 -0
  37. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNoiseProcessor.kt +795 -0
  38. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNsLogic.kt +180 -0
  39. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNsNative.kt +83 -0
  40. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNsStudio.kt +372 -0
  41. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxRecordStartGuard.kt +76 -0
  42. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxRecorderSeam.kt +434 -0
  43. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxSingerSource.kt +37 -0
  44. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxVoiceFx.kt +160 -0
  45. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/OtherAppAudioPolicy.kt +143 -0
  46. package/android/src/main/java/org/webrtc/audio/WebRtcAudioTrackHelper.kt +43 -0
  47. package/docs/ANDROID_NATIVE_HOOKS.md +102 -0
  48. package/docs/FEATURE_MATRIX.md +192 -0
  49. package/docs/IOS_NATIVE_HOOKS.md +190 -0
  50. package/gravix-rtc-react-native.podspec +49 -0
  51. package/ios/GravixRtc.h +7 -0
  52. package/ios/GravixRtc.mm +273 -0
  53. package/ios/GravixRtcSetup.h +29 -0
  54. package/ios/GravixRtcSetup.m +52 -0
  55. package/ios/audio/GravixRtcIosAudio.m +157 -0
  56. package/ios/audio/GxAudioDevice.h +62 -0
  57. package/ios/audio/GxAudioDevice.m +857 -0
  58. package/ios/audio/GxAudioSetup.h +34 -0
  59. package/ios/audio/GxAudioSetup.m +70 -0
  60. package/ios/audio/GxCompat.swift +53 -0
  61. package/ios/audio/GxIosAudio.swift +99 -0
  62. package/ios/audio/GxMusicController.swift +150 -0
  63. package/ios/audio/GxMusicPost.swift +362 -0
  64. package/ios/audio/GxNoiseProcessor.swift +718 -0
  65. package/ios/audio/GxNsDfn3CoreML.swift +195 -0
  66. package/ios/audio/GxNsStudioEngine.swift +237 -0
  67. package/ios/audio/GxNsStudioPack.swift +212 -0
  68. package/ios/audio/GxVoiceFx.swift +161 -0
  69. package/ios/audio/gx_adm_state.h +153 -0
  70. package/ios/gxcore/apple/gx_music_post.c +312 -0
  71. package/ios/gxcore/apple/gx_pcm.c +30 -0
  72. package/ios/gxcore/apple/gxns_build.h +19 -0
  73. package/ios/gxcore/apple/gxns_ios.c +17 -0
  74. package/ios/gxcore/apple/include/gx_fx.h +3 -0
  75. package/ios/gxcore/apple/include/gx_music_post.h +88 -0
  76. package/ios/gxcore/apple/include/gx_ns.h +3 -0
  77. package/ios/gxcore/apple/include/gx_pcm.h +33 -0
  78. package/ios/gxcore/apple/include/gxns_ios.h +18 -0
  79. package/ios/gxcore/apple/include/module.modulemap +10 -0
  80. package/ios/gxcore/apple/shim/rnnoise.h +2 -0
  81. package/ios/gxcore/apple/shim/speex_resampler.h +2 -0
  82. package/ios/gxcore/apple/units/gx_fx_forward.cpp +3 -0
  83. package/ios/gxcore/apple/units/gx_ns.c +7 -0
  84. package/ios/gxcore/apple/units/gx_ns_timer.c +7 -0
  85. package/ios/gxcore/apple/units/rnnoise_celt_lpc.c +7 -0
  86. package/ios/gxcore/apple/units/rnnoise_denoise.c +7 -0
  87. package/ios/gxcore/apple/units/rnnoise_kiss_fft.c +7 -0
  88. package/ios/gxcore/apple/units/rnnoise_pitch.c +7 -0
  89. package/ios/gxcore/apple/units/rnnoise_rnn.c +7 -0
  90. package/ios/gxcore/apple/units/rnnoise_rnn_data.c +7 -0
  91. package/ios/gxcore/apple/units/speexdsp_resample.c +7 -0
  92. package/ios/resources/ns/DFN3-NOTICE.txt +10 -0
  93. package/ios/resources/ns/DeepFilterNet-LICENSE-APACHE +201 -0
  94. package/ios/resources/ns/DeepFilterNet-LICENSE-MIT +19 -0
  95. package/ios/resources/ns/gxns_dfn3.mlmodelc/analytics/coremldata.bin +0 -0
  96. package/ios/resources/ns/gxns_dfn3.mlmodelc/coremldata.bin +0 -0
  97. package/ios/resources/ns/gxns_dfn3.mlmodelc/metadata.json +338 -0
  98. package/ios/resources/ns/gxns_dfn3.mlmodelc/model.mil +927 -0
  99. package/ios/resources/ns/gxns_dfn3.mlmodelc/weights/weight.bin +0 -0
  100. package/lib/module/android/bindings.js +49 -0
  101. package/lib/module/android/bindings.js.map +1 -0
  102. package/lib/module/android/index.js +13 -0
  103. package/lib/module/android/index.js.map +1 -0
  104. package/lib/module/android/micMute.js +341 -0
  105. package/lib/module/android/micMute.js.map +1 -0
  106. package/lib/module/android/nativeAudio.js +47 -0
  107. package/lib/module/android/nativeAudio.js.map +1 -0
  108. package/lib/module/android/noiseSuppression.js +170 -0
  109. package/lib/module/android/noiseSuppression.js.map +1 -0
  110. package/lib/module/android/roomMusic.js +142 -0
  111. package/lib/module/android/roomMusic.js.map +1 -0
  112. package/lib/module/android/singerMode.js +31 -0
  113. package/lib/module/android/singerMode.js.map +1 -0
  114. package/lib/module/android/voiceEffects.js +65 -0
  115. package/lib/module/android/voiceEffects.js.map +1 -0
  116. package/lib/module/audio/AudioManager.js +79 -0
  117. package/lib/module/audio/AudioManager.js.map +1 -0
  118. package/lib/module/audio/AudioSession.js +90 -0
  119. package/lib/module/audio/AudioSession.js.map +1 -0
  120. package/lib/module/audio/remoteVolume.js +54 -0
  121. package/lib/module/audio/remoteVolume.js.map +1 -0
  122. package/lib/module/components/VideoView.js +109 -0
  123. package/lib/module/components/VideoView.js.map +1 -0
  124. package/lib/module/features/audioScenario.js +53 -0
  125. package/lib/module/features/audioScenario.js.map +1 -0
  126. package/lib/module/features/beauty.js +828 -0
  127. package/lib/module/features/beauty.js.map +1 -0
  128. package/lib/module/features/micRelease.js +89 -0
  129. package/lib/module/features/micRelease.js.map +1 -0
  130. package/lib/module/features/noiseSuppression.js +213 -0
  131. package/lib/module/features/noiseSuppression.js.map +1 -0
  132. package/lib/module/features/roomMusic.js +90 -0
  133. package/lib/module/features/roomMusic.js.map +1 -0
  134. package/lib/module/features/roomMusicAndroid.js +294 -0
  135. package/lib/module/features/roomMusicAndroid.js.map +1 -0
  136. package/lib/module/features/roomMusicIos.js +250 -0
  137. package/lib/module/features/roomMusicIos.js.map +1 -0
  138. package/lib/module/features/roomMusicTypes.js +53 -0
  139. package/lib/module/features/roomMusicTypes.js.map +1 -0
  140. package/lib/module/features/screenShare.js +22 -0
  141. package/lib/module/features/screenShare.js.map +1 -0
  142. package/lib/module/features/singerMode.js +73 -0
  143. package/lib/module/features/singerMode.js.map +1 -0
  144. package/lib/module/features/voiceEffects.js +148 -0
  145. package/lib/module/features/voiceEffects.js.map +1 -0
  146. package/lib/module/hooks/context.js +34 -0
  147. package/lib/module/hooks/context.js.map +1 -0
  148. package/lib/module/hooks/hooks.js +145 -0
  149. package/lib/module/hooks/hooks.js.map +1 -0
  150. package/lib/module/hooks/types.js +4 -0
  151. package/lib/module/hooks/types.js.map +1 -0
  152. package/lib/module/hooks/useRoomEvents.js +30 -0
  153. package/lib/module/hooks/useRoomEvents.js.map +1 -0
  154. package/lib/module/index.js +43 -0
  155. package/lib/module/index.js.map +1 -0
  156. package/lib/module/ios/autoAttach.js +14 -0
  157. package/lib/module/ios/autoAttach.js.map +1 -0
  158. package/lib/module/ios/iosAudio.js +149 -0
  159. package/lib/module/ios/iosAudio.js.map +1 -0
  160. package/lib/module/join/appStateLifecycle.js +54 -0
  161. package/lib/module/join/appStateLifecycle.js.map +1 -0
  162. package/lib/module/micPolicy.js +249 -0
  163. package/lib/module/micPolicy.js.map +1 -0
  164. package/lib/module/native/NativeGravixAudio.js +18 -0
  165. package/lib/module/native/NativeGravixAudio.js.map +1 -0
  166. package/lib/module/native/NativeGravixRtc.js +13 -0
  167. package/lib/module/native/NativeGravixRtc.js.map +1 -0
  168. package/lib/module/native/module.js +23 -0
  169. package/lib/module/native/module.js.map +1 -0
  170. package/lib/module/package.json +1 -0
  171. package/lib/module/polyfills/DOMException.js +22 -0
  172. package/lib/module/polyfills/DOMException.js.map +1 -0
  173. package/lib/module/polyfills/early.js +18 -0
  174. package/lib/module/polyfills/early.js.map +1 -0
  175. package/lib/module/polyfills/event.js +71 -0
  176. package/lib/module/polyfills/event.js.map +1 -0
  177. package/lib/module/polyfills/sha256.js +92 -0
  178. package/lib/module/polyfills/sha256.js.map +1 -0
  179. package/lib/module/polyfills/subtleHmac.js +91 -0
  180. package/lib/module/polyfills/subtleHmac.js.map +1 -0
  181. package/lib/module/polyfills/textCoding.js +164 -0
  182. package/lib/module/polyfills/textCoding.js.map +1 -0
  183. package/lib/module/registerGlobals.js +135 -0
  184. package/lib/module/registerGlobals.js.map +1 -0
  185. package/lib/module/unsupported.js +90 -0
  186. package/lib/module/unsupported.js.map +1 -0
  187. package/lib/module/version.js +7 -0
  188. package/lib/module/version.js.map +1 -0
  189. package/lib/typescript/package.json +1 -0
  190. package/lib/typescript/src/android/bindings.d.ts +14 -0
  191. package/lib/typescript/src/android/bindings.d.ts.map +1 -0
  192. package/lib/typescript/src/android/index.d.ts +9 -0
  193. package/lib/typescript/src/android/index.d.ts.map +1 -0
  194. package/lib/typescript/src/android/micMute.d.ts +124 -0
  195. package/lib/typescript/src/android/micMute.d.ts.map +1 -0
  196. package/lib/typescript/src/android/nativeAudio.d.ts +40 -0
  197. package/lib/typescript/src/android/nativeAudio.d.ts.map +1 -0
  198. package/lib/typescript/src/android/noiseSuppression.d.ts +48 -0
  199. package/lib/typescript/src/android/noiseSuppression.d.ts.map +1 -0
  200. package/lib/typescript/src/android/roomMusic.d.ts +80 -0
  201. package/lib/typescript/src/android/roomMusic.d.ts.map +1 -0
  202. package/lib/typescript/src/android/singerMode.d.ts +27 -0
  203. package/lib/typescript/src/android/singerMode.d.ts.map +1 -0
  204. package/lib/typescript/src/android/voiceEffects.d.ts +30 -0
  205. package/lib/typescript/src/android/voiceEffects.d.ts.map +1 -0
  206. package/lib/typescript/src/audio/AudioManager.d.ts +32 -0
  207. package/lib/typescript/src/audio/AudioManager.d.ts.map +1 -0
  208. package/lib/typescript/src/audio/AudioSession.d.ts +70 -0
  209. package/lib/typescript/src/audio/AudioSession.d.ts.map +1 -0
  210. package/lib/typescript/src/audio/remoteVolume.d.ts +8 -0
  211. package/lib/typescript/src/audio/remoteVolume.d.ts.map +1 -0
  212. package/lib/typescript/src/components/VideoView.d.ts +44 -0
  213. package/lib/typescript/src/components/VideoView.d.ts.map +1 -0
  214. package/lib/typescript/src/features/audioScenario.d.ts +24 -0
  215. package/lib/typescript/src/features/audioScenario.d.ts.map +1 -0
  216. package/lib/typescript/src/features/beauty.d.ts +377 -0
  217. package/lib/typescript/src/features/beauty.d.ts.map +1 -0
  218. package/lib/typescript/src/features/micRelease.d.ts +28 -0
  219. package/lib/typescript/src/features/micRelease.d.ts.map +1 -0
  220. package/lib/typescript/src/features/noiseSuppression.d.ts +64 -0
  221. package/lib/typescript/src/features/noiseSuppression.d.ts.map +1 -0
  222. package/lib/typescript/src/features/roomMusic.d.ts +41 -0
  223. package/lib/typescript/src/features/roomMusic.d.ts.map +1 -0
  224. package/lib/typescript/src/features/roomMusicAndroid.d.ts +60 -0
  225. package/lib/typescript/src/features/roomMusicAndroid.d.ts.map +1 -0
  226. package/lib/typescript/src/features/roomMusicIos.d.ts +56 -0
  227. package/lib/typescript/src/features/roomMusicIos.d.ts.map +1 -0
  228. package/lib/typescript/src/features/roomMusicTypes.d.ts +76 -0
  229. package/lib/typescript/src/features/roomMusicTypes.d.ts.map +1 -0
  230. package/lib/typescript/src/features/screenShare.d.ts +12 -0
  231. package/lib/typescript/src/features/screenShare.d.ts.map +1 -0
  232. package/lib/typescript/src/features/singerMode.d.ts +20 -0
  233. package/lib/typescript/src/features/singerMode.d.ts.map +1 -0
  234. package/lib/typescript/src/features/voiceEffects.d.ts +46 -0
  235. package/lib/typescript/src/features/voiceEffects.d.ts.map +1 -0
  236. package/lib/typescript/src/hooks/context.d.ts +12 -0
  237. package/lib/typescript/src/hooks/context.d.ts.map +1 -0
  238. package/lib/typescript/src/hooks/hooks.d.ts +54 -0
  239. package/lib/typescript/src/hooks/hooks.d.ts.map +1 -0
  240. package/lib/typescript/src/hooks/types.d.ts +8 -0
  241. package/lib/typescript/src/hooks/types.d.ts.map +1 -0
  242. package/lib/typescript/src/hooks/useRoomEvents.d.ts +13 -0
  243. package/lib/typescript/src/hooks/useRoomEvents.d.ts.map +1 -0
  244. package/lib/typescript/src/index.d.ts +37 -0
  245. package/lib/typescript/src/index.d.ts.map +1 -0
  246. package/lib/typescript/src/ios/autoAttach.d.ts +2 -0
  247. package/lib/typescript/src/ios/autoAttach.d.ts.map +1 -0
  248. package/lib/typescript/src/ios/iosAudio.d.ts +96 -0
  249. package/lib/typescript/src/ios/iosAudio.d.ts.map +1 -0
  250. package/lib/typescript/src/join/appStateLifecycle.d.ts +14 -0
  251. package/lib/typescript/src/join/appStateLifecycle.d.ts.map +1 -0
  252. package/lib/typescript/src/micPolicy.d.ts +104 -0
  253. package/lib/typescript/src/micPolicy.d.ts.map +1 -0
  254. package/lib/typescript/src/native/NativeGravixAudio.d.ts +21 -0
  255. package/lib/typescript/src/native/NativeGravixAudio.d.ts.map +1 -0
  256. package/lib/typescript/src/native/NativeGravixRtc.d.ts +31 -0
  257. package/lib/typescript/src/native/NativeGravixRtc.d.ts.map +1 -0
  258. package/lib/typescript/src/native/module.d.ts +7 -0
  259. package/lib/typescript/src/native/module.d.ts.map +1 -0
  260. package/lib/typescript/src/polyfills/DOMException.d.ts +3 -0
  261. package/lib/typescript/src/polyfills/DOMException.d.ts.map +1 -0
  262. package/lib/typescript/src/polyfills/early.d.ts +2 -0
  263. package/lib/typescript/src/polyfills/early.d.ts.map +1 -0
  264. package/lib/typescript/src/polyfills/event.d.ts +2 -0
  265. package/lib/typescript/src/polyfills/event.d.ts.map +1 -0
  266. package/lib/typescript/src/polyfills/sha256.d.ts +3 -0
  267. package/lib/typescript/src/polyfills/sha256.d.ts.map +1 -0
  268. package/lib/typescript/src/polyfills/subtleHmac.d.ts +37 -0
  269. package/lib/typescript/src/polyfills/subtleHmac.d.ts.map +1 -0
  270. package/lib/typescript/src/polyfills/textCoding.d.ts +36 -0
  271. package/lib/typescript/src/polyfills/textCoding.d.ts.map +1 -0
  272. package/lib/typescript/src/registerGlobals.d.ts +42 -0
  273. package/lib/typescript/src/registerGlobals.d.ts.map +1 -0
  274. package/lib/typescript/src/unsupported.d.ts +42 -0
  275. package/lib/typescript/src/unsupported.d.ts.map +1 -0
  276. package/lib/typescript/src/version.d.ts +3 -0
  277. package/lib/typescript/src/version.d.ts.map +1 -0
  278. package/metro/index.js +39 -0
  279. package/metro/noise-stub.js +10 -0
  280. package/native/gxfx/include/gx_fx.h +82 -0
  281. package/native/gxfx/src/gx_fx.cpp +527 -0
  282. package/native/gxfx/third_party/README.md +4 -0
  283. package/native/gxfx/third_party/signalsmith-linear/LICENSE.txt +21 -0
  284. package/native/gxfx/third_party/signalsmith-linear/approx.h +191 -0
  285. package/native/gxfx/third_party/signalsmith-linear/fft.h +1386 -0
  286. package/native/gxfx/third_party/signalsmith-linear/linear.h +1129 -0
  287. package/native/gxfx/third_party/signalsmith-linear/platform/approx-cmsisdsp.h +40 -0
  288. package/native/gxfx/third_party/signalsmith-linear/platform/basic-fill-warnings.h +61 -0
  289. package/native/gxfx/third_party/signalsmith-linear/platform/fft-accelerate.h +340 -0
  290. package/native/gxfx/third_party/signalsmith-linear/platform/fft-cmsisdsp.h +307 -0
  291. package/native/gxfx/third_party/signalsmith-linear/platform/fft-ipp.h +532 -0
  292. package/native/gxfx/third_party/signalsmith-linear/platform/fft-linear.h +213 -0
  293. package/native/gxfx/third_party/signalsmith-linear/platform/fft-pffft-double.h +221 -0
  294. package/native/gxfx/third_party/signalsmith-linear/platform/fft-pffft.h +221 -0
  295. package/native/gxfx/third_party/signalsmith-linear/platform/linear-accelerate.h +593 -0
  296. package/native/gxfx/third_party/signalsmith-linear/platform/linear-cmsisdsp.h +713 -0
  297. package/native/gxfx/third_party/signalsmith-linear/platform/linear-xsimd-dispatch.cpp +6 -0
  298. package/native/gxfx/third_party/signalsmith-linear/platform/linear-xsimd.h +818 -0
  299. package/native/gxfx/third_party/signalsmith-linear/stft.h +700 -0
  300. package/native/gxfx/third_party/signalsmith-stretch-LICENSE.txt +21 -0
  301. package/native/gxfx/third_party/signalsmith-stretch.h +1060 -0
  302. package/native/gxns/CMakeLists.txt +67 -0
  303. package/native/gxns/include/gx_ns.h +285 -0
  304. package/native/gxns/src/gx_ns.c +1518 -0
  305. package/native/gxns/src/gx_ns_timer.c +84 -0
  306. package/native/gxns/src/gx_ns_timer.h +29 -0
  307. package/native/gxns/third_party/VENDOR.md +43 -0
  308. package/native/gxns/third_party/rnnoise/AUTHORS +1 -0
  309. package/native/gxns/third_party/rnnoise/COPYING +31 -0
  310. package/native/gxns/third_party/rnnoise/include/rnnoise.h +117 -0
  311. package/native/gxns/third_party/rnnoise/src/_kiss_fft_guts.h +182 -0
  312. package/native/gxns/third_party/rnnoise/src/arch.h +261 -0
  313. package/native/gxns/third_party/rnnoise/src/celt_lpc.c +172 -0
  314. package/native/gxns/third_party/rnnoise/src/celt_lpc.h +45 -0
  315. package/native/gxns/third_party/rnnoise/src/common.h +48 -0
  316. package/native/gxns/third_party/rnnoise/src/denoise.c +664 -0
  317. package/native/gxns/third_party/rnnoise/src/kiss_fft.c +601 -0
  318. package/native/gxns/third_party/rnnoise/src/kiss_fft.h +203 -0
  319. package/native/gxns/third_party/rnnoise/src/opus_types.h +159 -0
  320. package/native/gxns/third_party/rnnoise/src/pitch.c +523 -0
  321. package/native/gxns/third_party/rnnoise/src/pitch.h +149 -0
  322. package/native/gxns/third_party/rnnoise/src/rnn.c +178 -0
  323. package/native/gxns/third_party/rnnoise/src/rnn.h +65 -0
  324. package/native/gxns/third_party/rnnoise/src/rnn_data.c +11051 -0
  325. package/native/gxns/third_party/rnnoise/src/rnn_data.h +34 -0
  326. package/native/gxns/third_party/rnnoise/src/tansig_table.h +45 -0
  327. package/native/gxns/third_party/speexdsp/AUTHORS +18 -0
  328. package/native/gxns/third_party/speexdsp/COPYING +35 -0
  329. package/native/gxns/third_party/speexdsp/arch.h +232 -0
  330. package/native/gxns/third_party/speexdsp/resample.c +1239 -0
  331. package/native/gxns/third_party/speexdsp/resample_neon.h +339 -0
  332. package/native/gxns/third_party/speexdsp/resample_sse.h +128 -0
  333. package/native/gxns/third_party/speexdsp/speex_resampler.h +343 -0
  334. package/package.json +186 -4
  335. package/src/android/bindings.ts +61 -0
  336. package/src/android/index.ts +10 -0
  337. package/src/android/micMute.ts +422 -0
  338. package/src/android/nativeAudio.ts +94 -0
  339. package/src/android/noiseSuppression.ts +209 -0
  340. package/src/android/roomMusic.ts +193 -0
  341. package/src/android/singerMode.ts +53 -0
  342. package/src/android/voiceEffects.ts +126 -0
  343. package/src/audio/AudioManager.ts +111 -0
  344. package/src/audio/AudioSession.ts +190 -0
  345. package/src/audio/remoteVolume.ts +58 -0
  346. package/src/components/VideoView.tsx +152 -0
  347. package/src/features/audioScenario.ts +58 -0
  348. package/src/features/beauty.ts +1057 -0
  349. package/src/features/micRelease.ts +108 -0
  350. package/src/features/noiseSuppression.ts +251 -0
  351. package/src/features/roomMusic.ts +106 -0
  352. package/src/features/roomMusicAndroid.ts +310 -0
  353. package/src/features/roomMusicIos.ts +300 -0
  354. package/src/features/roomMusicTypes.ts +97 -0
  355. package/src/features/screenShare.ts +19 -0
  356. package/src/features/singerMode.ts +70 -0
  357. package/src/features/voiceEffects.ts +245 -0
  358. package/src/hooks/context.tsx +38 -0
  359. package/src/hooks/hooks.ts +247 -0
  360. package/src/hooks/types.ts +10 -0
  361. package/src/hooks/useRoomEvents.ts +35 -0
  362. package/src/index.tsx +134 -0
  363. package/src/ios/autoAttach.ts +11 -0
  364. package/src/ios/iosAudio.ts +202 -0
  365. package/src/join/appStateLifecycle.ts +55 -0
  366. package/src/micPolicy.ts +312 -0
  367. package/src/native/NativeGravixAudio.ts +30 -0
  368. package/src/native/NativeGravixRtc.ts +38 -0
  369. package/src/native/module.ts +22 -0
  370. package/src/polyfills/DOMException.ts +20 -0
  371. package/src/polyfills/early.ts +16 -0
  372. package/src/polyfills/event.ts +88 -0
  373. package/src/polyfills/sha256.ts +112 -0
  374. package/src/polyfills/subtleHmac.ts +124 -0
  375. package/src/polyfills/textCoding.ts +197 -0
  376. package/src/registerGlobals.ts +201 -0
  377. package/src/unsupported.ts +139 -0
  378. package/src/version.ts +4 -0
@@ -0,0 +1,343 @@
1
+ /* Copyright (C) 2007 Jean-Marc Valin
2
+
3
+ File: speex_resampler.h
4
+ Resampling code
5
+
6
+ The design goals of this code are:
7
+ - Very fast algorithm
8
+ - Low memory requirement
9
+ - Good *perceptual* quality (and not best SNR)
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are
13
+ met:
14
+
15
+ 1. Redistributions of source code must retain the above copyright notice,
16
+ this list of conditions and the following disclaimer.
17
+
18
+ 2. Redistributions in binary form must reproduce the above copyright
19
+ notice, this list of conditions and the following disclaimer in the
20
+ documentation and/or other materials provided with the distribution.
21
+
22
+ 3. The name of the author may not be used to endorse or promote products
23
+ derived from this software without specific prior written permission.
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28
+ DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
29
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34
+ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35
+ POSSIBILITY OF SUCH DAMAGE.
36
+ */
37
+
38
+
39
+ #ifndef SPEEX_RESAMPLER_H
40
+ #define SPEEX_RESAMPLER_H
41
+
42
+ #ifdef OUTSIDE_SPEEX
43
+
44
+ /********* WARNING: MENTAL SANITY ENDS HERE *************/
45
+
46
+ /* If the resampler is defined outside of Speex, we change the symbol names so that
47
+ there won't be any clash if linking with Speex later on. */
48
+
49
+ /* #define RANDOM_PREFIX your software name here */
50
+ #ifndef RANDOM_PREFIX
51
+ #error "Please define RANDOM_PREFIX (above) to something specific to your project to prevent symbol name clashes"
52
+ #endif
53
+
54
+ #define CAT_PREFIX2(a,b) a ## b
55
+ #define CAT_PREFIX(a,b) CAT_PREFIX2(a, b)
56
+
57
+ #define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init)
58
+ #define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac)
59
+ #define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy)
60
+ #define speex_resampler_process_float CAT_PREFIX(RANDOM_PREFIX,_resampler_process_float)
61
+ #define speex_resampler_process_int CAT_PREFIX(RANDOM_PREFIX,_resampler_process_int)
62
+ #define speex_resampler_process_interleaved_float CAT_PREFIX(RANDOM_PREFIX,_resampler_process_interleaved_float)
63
+ #define speex_resampler_process_interleaved_int CAT_PREFIX(RANDOM_PREFIX,_resampler_process_interleaved_int)
64
+ #define speex_resampler_set_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_set_rate)
65
+ #define speex_resampler_get_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_get_rate)
66
+ #define speex_resampler_set_rate_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_set_rate_frac)
67
+ #define speex_resampler_get_ratio CAT_PREFIX(RANDOM_PREFIX,_resampler_get_ratio)
68
+ #define speex_resampler_set_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_set_quality)
69
+ #define speex_resampler_get_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_get_quality)
70
+ #define speex_resampler_set_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_input_stride)
71
+ #define speex_resampler_get_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_stride)
72
+ #define speex_resampler_set_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_output_stride)
73
+ #define speex_resampler_get_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_stride)
74
+ #define speex_resampler_get_input_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_latency)
75
+ #define speex_resampler_get_output_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_latency)
76
+ #define speex_resampler_skip_zeros CAT_PREFIX(RANDOM_PREFIX,_resampler_skip_zeros)
77
+ #define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem)
78
+ #define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerror)
79
+
80
+ #define spx_int16_t short
81
+ #define spx_int32_t int
82
+ #define spx_uint16_t unsigned short
83
+ #define spx_uint32_t unsigned int
84
+
85
+ #define speex_assert(cond)
86
+
87
+ #else /* OUTSIDE_SPEEX */
88
+
89
+ #include "speexdsp_types.h"
90
+
91
+ #endif /* OUTSIDE_SPEEX */
92
+
93
+ #ifdef __cplusplus
94
+ extern "C" {
95
+ #endif
96
+
97
+ #define SPEEX_RESAMPLER_QUALITY_MAX 10
98
+ #define SPEEX_RESAMPLER_QUALITY_MIN 0
99
+ #define SPEEX_RESAMPLER_QUALITY_DEFAULT 4
100
+ #define SPEEX_RESAMPLER_QUALITY_VOIP 3
101
+ #define SPEEX_RESAMPLER_QUALITY_DESKTOP 5
102
+
103
+ enum {
104
+ RESAMPLER_ERR_SUCCESS = 0,
105
+ RESAMPLER_ERR_ALLOC_FAILED = 1,
106
+ RESAMPLER_ERR_BAD_STATE = 2,
107
+ RESAMPLER_ERR_INVALID_ARG = 3,
108
+ RESAMPLER_ERR_PTR_OVERLAP = 4,
109
+ RESAMPLER_ERR_OVERFLOW = 5,
110
+
111
+ RESAMPLER_ERR_MAX_ERROR
112
+ };
113
+
114
+ struct SpeexResamplerState_;
115
+ typedef struct SpeexResamplerState_ SpeexResamplerState;
116
+
117
+ /** Create a new resampler with integer input and output rates.
118
+ * @param nb_channels Number of channels to be processed
119
+ * @param in_rate Input sampling rate (integer number of Hz).
120
+ * @param out_rate Output sampling rate (integer number of Hz).
121
+ * @param quality Resampling quality between 0 and 10, where 0 has poor quality
122
+ * and 10 has very high quality.
123
+ * @return Newly created resampler state
124
+ * @retval NULL Error: not enough memory
125
+ */
126
+ SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
127
+ spx_uint32_t in_rate,
128
+ spx_uint32_t out_rate,
129
+ int quality,
130
+ int *err);
131
+
132
+ /** Create a new resampler with fractional input/output rates. The sampling
133
+ * rate ratio is an arbitrary rational number with both the numerator and
134
+ * denominator being 32-bit integers.
135
+ * @param nb_channels Number of channels to be processed
136
+ * @param ratio_num Numerator of the sampling rate ratio
137
+ * @param ratio_den Denominator of the sampling rate ratio
138
+ * @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
139
+ * @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
140
+ * @param quality Resampling quality between 0 and 10, where 0 has poor quality
141
+ * and 10 has very high quality.
142
+ * @return Newly created resampler state
143
+ * @retval NULL Error: not enough memory
144
+ */
145
+ SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
146
+ spx_uint32_t ratio_num,
147
+ spx_uint32_t ratio_den,
148
+ spx_uint32_t in_rate,
149
+ spx_uint32_t out_rate,
150
+ int quality,
151
+ int *err);
152
+
153
+ /** Destroy a resampler state.
154
+ * @param st Resampler state
155
+ */
156
+ void speex_resampler_destroy(SpeexResamplerState *st);
157
+
158
+ /** Resample a float array. The input and output buffers must *not* overlap.
159
+ * @param st Resampler state
160
+ * @param channel_index Index of the channel to process for the multi-channel
161
+ * base (0 otherwise)
162
+ * @param in Input buffer
163
+ * @param in_len Number of input samples in the input buffer. Returns the
164
+ * number of samples processed
165
+ * @param out Output buffer
166
+ * @param out_len Size of the output buffer. Returns the number of samples written
167
+ */
168
+ int speex_resampler_process_float(SpeexResamplerState *st,
169
+ spx_uint32_t channel_index,
170
+ const float *in,
171
+ spx_uint32_t *in_len,
172
+ float *out,
173
+ spx_uint32_t *out_len);
174
+
175
+ /** Resample an int array. The input and output buffers must *not* overlap.
176
+ * @param st Resampler state
177
+ * @param channel_index Index of the channel to process for the multi-channel
178
+ * base (0 otherwise)
179
+ * @param in Input buffer
180
+ * @param in_len Number of input samples in the input buffer. Returns the number
181
+ * of samples processed
182
+ * @param out Output buffer
183
+ * @param out_len Size of the output buffer. Returns the number of samples written
184
+ */
185
+ int speex_resampler_process_int(SpeexResamplerState *st,
186
+ spx_uint32_t channel_index,
187
+ const spx_int16_t *in,
188
+ spx_uint32_t *in_len,
189
+ spx_int16_t *out,
190
+ spx_uint32_t *out_len);
191
+
192
+ /** Resample an interleaved float array. The input and output buffers must *not* overlap.
193
+ * @param st Resampler state
194
+ * @param in Input buffer
195
+ * @param in_len Number of input samples in the input buffer. Returns the number
196
+ * of samples processed. This is all per-channel.
197
+ * @param out Output buffer
198
+ * @param out_len Size of the output buffer. Returns the number of samples written.
199
+ * This is all per-channel.
200
+ */
201
+ int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
202
+ const float *in,
203
+ spx_uint32_t *in_len,
204
+ float *out,
205
+ spx_uint32_t *out_len);
206
+
207
+ /** Resample an interleaved int array. The input and output buffers must *not* overlap.
208
+ * @param st Resampler state
209
+ * @param in Input buffer
210
+ * @param in_len Number of input samples in the input buffer. Returns the number
211
+ * of samples processed. This is all per-channel.
212
+ * @param out Output buffer
213
+ * @param out_len Size of the output buffer. Returns the number of samples written.
214
+ * This is all per-channel.
215
+ */
216
+ int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
217
+ const spx_int16_t *in,
218
+ spx_uint32_t *in_len,
219
+ spx_int16_t *out,
220
+ spx_uint32_t *out_len);
221
+
222
+ /** Set (change) the input/output sampling rates (integer value).
223
+ * @param st Resampler state
224
+ * @param in_rate Input sampling rate (integer number of Hz).
225
+ * @param out_rate Output sampling rate (integer number of Hz).
226
+ */
227
+ int speex_resampler_set_rate(SpeexResamplerState *st,
228
+ spx_uint32_t in_rate,
229
+ spx_uint32_t out_rate);
230
+
231
+ /** Get the current input/output sampling rates (integer value).
232
+ * @param st Resampler state
233
+ * @param in_rate Input sampling rate (integer number of Hz) copied.
234
+ * @param out_rate Output sampling rate (integer number of Hz) copied.
235
+ */
236
+ void speex_resampler_get_rate(SpeexResamplerState *st,
237
+ spx_uint32_t *in_rate,
238
+ spx_uint32_t *out_rate);
239
+
240
+ /** Set (change) the input/output sampling rates and resampling ratio
241
+ * (fractional values in Hz supported).
242
+ * @param st Resampler state
243
+ * @param ratio_num Numerator of the sampling rate ratio
244
+ * @param ratio_den Denominator of the sampling rate ratio
245
+ * @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
246
+ * @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
247
+ */
248
+ int speex_resampler_set_rate_frac(SpeexResamplerState *st,
249
+ spx_uint32_t ratio_num,
250
+ spx_uint32_t ratio_den,
251
+ spx_uint32_t in_rate,
252
+ spx_uint32_t out_rate);
253
+
254
+ /** Get the current resampling ratio. This will be reduced to the least
255
+ * common denominator.
256
+ * @param st Resampler state
257
+ * @param ratio_num Numerator of the sampling rate ratio copied
258
+ * @param ratio_den Denominator of the sampling rate ratio copied
259
+ */
260
+ void speex_resampler_get_ratio(SpeexResamplerState *st,
261
+ spx_uint32_t *ratio_num,
262
+ spx_uint32_t *ratio_den);
263
+
264
+ /** Set (change) the conversion quality.
265
+ * @param st Resampler state
266
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
267
+ * quality and 10 has very high quality.
268
+ */
269
+ int speex_resampler_set_quality(SpeexResamplerState *st,
270
+ int quality);
271
+
272
+ /** Get the conversion quality.
273
+ * @param st Resampler state
274
+ * @param quality Resampling quality between 0 and 10, where 0 has poor
275
+ * quality and 10 has very high quality.
276
+ */
277
+ void speex_resampler_get_quality(SpeexResamplerState *st,
278
+ int *quality);
279
+
280
+ /** Set (change) the input stride.
281
+ * @param st Resampler state
282
+ * @param stride Input stride
283
+ */
284
+ void speex_resampler_set_input_stride(SpeexResamplerState *st,
285
+ spx_uint32_t stride);
286
+
287
+ /** Get the input stride.
288
+ * @param st Resampler state
289
+ * @param stride Input stride copied
290
+ */
291
+ void speex_resampler_get_input_stride(SpeexResamplerState *st,
292
+ spx_uint32_t *stride);
293
+
294
+ /** Set (change) the output stride.
295
+ * @param st Resampler state
296
+ * @param stride Output stride
297
+ */
298
+ void speex_resampler_set_output_stride(SpeexResamplerState *st,
299
+ spx_uint32_t stride);
300
+
301
+ /** Get the output stride.
302
+ * @param st Resampler state copied
303
+ * @param stride Output stride
304
+ */
305
+ void speex_resampler_get_output_stride(SpeexResamplerState *st,
306
+ spx_uint32_t *stride);
307
+
308
+ /** Get the latency introduced by the resampler measured in input samples.
309
+ * @param st Resampler state
310
+ */
311
+ int speex_resampler_get_input_latency(SpeexResamplerState *st);
312
+
313
+ /** Get the latency introduced by the resampler measured in output samples.
314
+ * @param st Resampler state
315
+ */
316
+ int speex_resampler_get_output_latency(SpeexResamplerState *st);
317
+
318
+ /** Make sure that the first samples to go out of the resamplers don't have
319
+ * leading zeros. This is only useful before starting to use a newly created
320
+ * resampler. It is recommended to use that when resampling an audio file, as
321
+ * it will generate a file with the same length. For real-time processing,
322
+ * it is probably easier not to use this call (so that the output duration
323
+ * is the same for the first frame).
324
+ * @param st Resampler state
325
+ */
326
+ int speex_resampler_skip_zeros(SpeexResamplerState *st);
327
+
328
+ /** Reset a resampler so a new (unrelated) stream can be processed.
329
+ * @param st Resampler state
330
+ */
331
+ int speex_resampler_reset_mem(SpeexResamplerState *st);
332
+
333
+ /** Returns the English meaning for an error code
334
+ * @param err Error code
335
+ * @return English string
336
+ */
337
+ const char *speex_resampler_strerror(int err);
338
+
339
+ #ifdef __cplusplus
340
+ }
341
+ #endif
342
+
343
+ #endif
package/package.json CHANGED
@@ -1,6 +1,188 @@
1
1
  {
2
2
  "name": "gravix-rtc-react-native",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "React Native SDK for Gravix Cloud real-time voice, video and live rooms (Android and iOS).",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "gravix-rtc-react-native-source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json",
14
+ "./metro": "./metro/index.js"
15
+ },
16
+ "files": [
17
+ "src",
18
+ "lib",
19
+ "metro",
20
+ "android",
21
+ "ios",
22
+ "native",
23
+ "CHANGELOG.md",
24
+ "NOTICE",
25
+ "LICENSES",
26
+ "docs",
27
+ "*.podspec",
28
+ "!ios/build",
29
+ "!android/build",
30
+ "!android/gradle",
31
+ "!android/gradlew",
32
+ "!android/gradlew.bat",
33
+ "!android/local.properties",
34
+ "!**/__tests__",
35
+ "!**/__fixtures__",
36
+ "!**/__mocks__",
37
+ "!**/.*",
38
+ "!android/src/test",
39
+ "!android/src/studio",
40
+ "!ios/tests"
41
+ ],
42
+ "scripts": {
43
+ "example": "yarn workspace gravix-rtc-react-native-example",
44
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
45
+ "prepare": "bob build",
46
+ "typecheck": "tsc",
47
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
48
+ "test": "jest"
49
+ },
50
+ "keywords": [
51
+ "react-native",
52
+ "ios",
53
+ "android",
54
+ "webrtc",
55
+ "realtime",
56
+ "rtc",
57
+ "voice",
58
+ "video",
59
+ "gravix",
60
+ "gravix-cloud"
61
+ ],
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "git+https://github.com/assajeeb/gravix-rtc-react-native.git"
65
+ },
66
+ "author": "Gravity Compile <support@gravixcloud.com> (https://www.gravixcloud.com)",
67
+ "license": "MIT",
68
+ "bugs": {
69
+ "url": "https://github.com/assajeeb/gravix-rtc-react-native/issues"
70
+ },
71
+ "homepage": "https://www.gravixcloud.com/docs",
72
+ "publishConfig": {
73
+ "registry": "https://registry.npmjs.org/"
74
+ },
75
+ "devDependencies": {
76
+ "@eslint/compat": "^2.1.1",
77
+ "@eslint/eslintrc": "^3.3.7",
78
+ "@eslint/js": "^9.39.5",
79
+ "@react-native/babel-preset": "0.88.0",
80
+ "@react-native/eslint-config": "0.88.0",
81
+ "@react-native/jest-preset": "0.88.0",
82
+ "@types/jest": "^30.0.0",
83
+ "@types/node": "^24",
84
+ "@types/react": "^19.2.0",
85
+ "@types/react-test-renderer": "^19",
86
+ "del-cli": "^8.0.1",
87
+ "eslint": "^9.39.5",
88
+ "eslint-config-prettier": "^10.1.8",
89
+ "eslint-plugin-ft-flow": "^3.0.11",
90
+ "eslint-plugin-prettier": "^5.5.7",
91
+ "gravix-rtc": "0.10.0",
92
+ "jest": "^30.2.0",
93
+ "prettier": "^3.9.10",
94
+ "react": "19.3.0",
95
+ "react-native": "0.88.0",
96
+ "react-native-builder-bob": "^0.44.1",
97
+ "react-native-webrtc": "155.0.1",
98
+ "react-test-renderer": "19.3.0",
99
+ "turbo": "^2.11.10",
100
+ "typescript": "^6.0.3"
101
+ },
102
+ "peerDependencies": {
103
+ "gravix-rtc": ">=0.10.0 <0.12.0",
104
+ "react": ">=19.0.0",
105
+ "react-native": ">=0.88.0",
106
+ "react-native-gravix-effects": "^1.4.3",
107
+ "react-native-gravix-effects-webrtc": "^1.4.3",
108
+ "react-native-webrtc": "^155.0.0"
109
+ },
110
+ "workspaces": [
111
+ "example"
112
+ ],
113
+ "packageManager": "yarn@4.18.1",
114
+ "react-native-builder-bob": {
115
+ "source": "src",
116
+ "output": "lib",
117
+ "targets": [
118
+ [
119
+ "module",
120
+ {
121
+ "esm": true
122
+ }
123
+ ],
124
+ [
125
+ "typescript",
126
+ {
127
+ "project": "tsconfig.build.json"
128
+ }
129
+ ]
130
+ ]
131
+ },
132
+ "codegenConfig": {
133
+ "name": "GravixRtcSpec",
134
+ "type": "modules",
135
+ "jsSrcsDir": "src/native",
136
+ "android": {
137
+ "javaPackageName": "com.gravitycompile.gravixrtc"
138
+ }
139
+ },
140
+ "prettier": {
141
+ "quoteProps": "consistent",
142
+ "singleQuote": true,
143
+ "tabWidth": 2,
144
+ "trailingComma": "es5",
145
+ "useTabs": false
146
+ },
147
+ "create-react-native-library": {
148
+ "type": "turbo-module",
149
+ "languages": "kotlin-objc",
150
+ "tools": [
151
+ "eslint"
152
+ ],
153
+ "version": "0.64.0"
154
+ },
155
+ "dependencies": {
156
+ "array.prototype.at": "^1.1.1",
157
+ "promise.allsettled": "^1.0.7",
158
+ "react-native-url-polyfill": "^3.0.0",
159
+ "web-streams-polyfill": "^4.1.0",
160
+ "well-known-symbols": "^4.1.0"
161
+ },
162
+ "jest": {
163
+ "preset": "@react-native/jest-preset",
164
+ "modulePathIgnorePatterns": [
165
+ "<rootDir>/example/node_modules",
166
+ "<rootDir>/lib/"
167
+ ],
168
+ "testPathIgnorePatterns": [
169
+ "/node_modules/",
170
+ "<rootDir>/lib/",
171
+ "<rootDir>/example/"
172
+ ],
173
+ "setupFiles": [
174
+ "<rootDir>/jest.setup.js"
175
+ ],
176
+ "transformIgnorePatterns": [
177
+ "node_modules/(?!((jest-)?react-native|@react-native(-community)?|react-native-url-polyfill|react-native-webrtc)/)"
178
+ ]
179
+ },
180
+ "peerDependenciesMeta": {
181
+ "react-native-gravix-effects": {
182
+ "optional": true
183
+ },
184
+ "react-native-gravix-effects-webrtc": {
185
+ "optional": true
186
+ }
187
+ }
188
+ }
@@ -0,0 +1,61 @@
1
+ // Copyright (c) 2026 Gravity Compile. MIT License; see LICENSE.
2
+
3
+ import { DeviceEventEmitter, Platform } from 'react-native';
4
+ import NativeGravixAudio from '../native/NativeGravixAudio';
5
+ import { isFeatureSupported, type GravixNativeFeature } from '../unsupported';
6
+ import {
7
+ gravixAndroidAudioBridge,
8
+ setGravixAndroidAudioBridge,
9
+ type GravixAndroidAudioBridge,
10
+ type GravixAndroidAudioEvent,
11
+ type GravixAndroidAudioListener,
12
+ } from './nativeAudio';
13
+
14
+ /** Device event of `GravixAudioModule.kt`: `{ name, payload }`. */
15
+ export const GRAVIX_AUDIO_EVENT = 'GravixAudioEvent';
16
+
17
+ /** Installs the bridge over the `GravixAudio` TurboModule (Android). Idempotent; false when absent. */
18
+ export function installGravixAndroidAudioBridge(): boolean {
19
+ if (gravixAndroidAudioBridge()) return true;
20
+ if (Platform.OS !== 'android') return false;
21
+ const m = NativeGravixAudio;
22
+ if (!m) return false;
23
+ const bridge: GravixAndroidAudioBridge = {
24
+ async call(method, args = {}) {
25
+ const r = (await m.call(method, args)) as { value?: unknown } | null;
26
+ return r?.value ?? null;
27
+ },
28
+ addListener(
29
+ event: GravixAndroidAudioEvent,
30
+ listener: GravixAndroidAudioListener
31
+ ) {
32
+ const sub = DeviceEventEmitter.addListener(
33
+ GRAVIX_AUDIO_EVENT,
34
+ (e: { name?: string; payload?: unknown }) => {
35
+ if (e?.name === event)
36
+ listener((e.payload as Record<string, unknown> | null) ?? null);
37
+ }
38
+ );
39
+ return () => sub.remove();
40
+ },
41
+ };
42
+ setGravixAndroidAudioBridge(bridge);
43
+ return true;
44
+ }
45
+
46
+ /** The bridge, installed on first use. Null off Android or without the module. */
47
+ export function androidAudio(): GravixAndroidAudioBridge | null {
48
+ installGravixAndroidAudioBridge();
49
+ return gravixAndroidAudioBridge();
50
+ }
51
+
52
+ /**
53
+ * The bridge when [feature] runs natively here (Android, `GravixRtc.setup` done,
54
+ * capability flag on), else null: the caller then keeps its `unsupported*()` path.
55
+ */
56
+ export function androidAudioFor(
57
+ feature: GravixNativeFeature
58
+ ): GravixAndroidAudioBridge | null {
59
+ if (Platform.OS !== 'android' || !isFeatureSupported(feature)) return null;
60
+ return androidAudio();
61
+ }
@@ -0,0 +1,10 @@
1
+ // Copyright (c) 2026 Gravity Compile. MIT License; see LICENSE.
2
+
3
+ /** Android-native audio features (voice effects, noise suppression, room music, singer mode, mic release). */
4
+ export * from './nativeAudio';
5
+ export * from './voiceEffects';
6
+ export * from './noiseSuppression';
7
+ export * from './roomMusic';
8
+ export * from './singerMode';
9
+ export * from './micMute';
10
+ export * from './bindings';