@siteed/expo-audio-stream 1.1.5 → 1.1.7

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 (308) hide show
  1. package/.eslintrc.js +2 -0
  2. package/.size-limit.json +6 -0
  3. package/.yarn/install-state.gz +0 -0
  4. package/android/.gradle/8.1.1/checksums/checksums.lock +0 -0
  5. package/android/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  6. package/android/.gradle/8.1.1/dependencies-accessors/gc.properties +0 -0
  7. package/android/.gradle/8.1.1/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/8.1.1/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/8.1.1/gc.properties +0 -0
  10. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  11. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  12. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  13. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  14. package/android/.gradle/8.9/gc.properties +0 -0
  15. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  16. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  17. package/android/.gradle/vcs-1/gc.properties +0 -0
  18. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/results.bin +1 -0
  19. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioAnalysisData$AmplitudeRange.dex +0 -0
  20. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioAnalysisData$SpeakerChange.dex +0 -0
  21. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioAnalysisData.dex +0 -0
  22. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioDataEncoder.dex +0 -0
  23. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioFileHandler.dex +0 -0
  24. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioFormatUtils.dex +0 -0
  25. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor$AudioData.dex +0 -0
  26. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor$Companion.dex +0 -0
  27. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor$extractMFCC$powerSpectrum$2.dex +0 -0
  28. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor.dex +0 -0
  29. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioRecorderManager.dex +0 -0
  30. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/BuildConfig.dex +0 -0
  31. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/Constants.dex +0 -0
  32. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/DataPoint.dex +0 -0
  33. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/EventSender.dex +0 -0
  34. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$1.dex +0 -0
  35. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$10.dex +0 -0
  36. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$11.dex +0 -0
  37. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$12.dex +0 -0
  38. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$13.dex +0 -0
  39. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$14.dex +0 -0
  40. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$15.dex +0 -0
  41. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$16.dex +0 -0
  42. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$17.dex +0 -0
  43. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$18.dex +0 -0
  44. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$2.dex +0 -0
  45. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$3.dex +0 -0
  46. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$4.dex +0 -0
  47. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$5.dex +0 -0
  48. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$6.dex +0 -0
  49. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$7.dex +0 -0
  50. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$8.dex +0 -0
  51. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$9.dex +0 -0
  52. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$1.dex +0 -0
  53. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$2.dex +0 -0
  54. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$3.dex +0 -0
  55. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$4.dex +0 -0
  56. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$1.dex +0 -0
  57. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$2.dex +0 -0
  58. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule.dex +0 -0
  59. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/FFT.dex +0 -0
  60. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/Features.dex +0 -0
  61. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/PermissionUtils.dex +0 -0
  62. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/RecordingConfig.dex +0 -0
  63. package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/desugar_graph.bin +0 -0
  64. package/android/build/.transforms/7bc0cb35da9eb644120553a3af66f984/results.bin +1 -0
  65. package/android/build/.transforms/7bc0cb35da9eb644120553a3af66f984/transformed/classes/classes_dex/classes.dex +0 -0
  66. package/android/build/.transforms/949f6bd23bdf38f67d1eb7de8f618950/results.bin +1 -0
  67. package/android/build/.transforms/949f6bd23bdf38f67d1eb7de8f618950/transformed/classes/classes_dex/classes.dex +0 -0
  68. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +10 -0
  69. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
  70. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +6 -0
  71. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
  72. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  73. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  74. package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -0
  75. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  76. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  77. package/android/build/intermediates/java_res/debug/out/META-INF/siteed-expo-audio-stream_debug.kotlin_module +0 -0
  78. package/android/build/intermediates/javac/debug/classes/net/siteed/audiostream/BuildConfig.class +0 -0
  79. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
  80. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +14 -0
  81. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +10 -0
  82. package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
  83. package/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/siteed-expo-audio-stream_debug.kotlin_module +0 -0
  84. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioAnalysisData$AmplitudeRange.class +0 -0
  85. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioAnalysisData$SpeakerChange.class +0 -0
  86. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioAnalysisData.class +0 -0
  87. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioDataEncoder.class +0 -0
  88. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioFileHandler.class +0 -0
  89. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioFormatUtils.class +0 -0
  90. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioProcessor$AudioData.class +0 -0
  91. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioProcessor$Companion.class +0 -0
  92. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioProcessor$extractMFCC$powerSpectrum$2.class +0 -0
  93. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioProcessor.class +0 -0
  94. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioRecorderManager.class +0 -0
  95. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/BuildConfig.class +0 -0
  96. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/Constants.class +0 -0
  97. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/DataPoint.class +0 -0
  98. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/EventSender.class +0 -0
  99. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$1.class +0 -0
  100. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$10.class +0 -0
  101. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$11.class +0 -0
  102. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$12.class +0 -0
  103. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$13.class +0 -0
  104. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$14.class +0 -0
  105. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$15.class +0 -0
  106. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$16.class +0 -0
  107. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$17.class +0 -0
  108. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$18.class +0 -0
  109. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$2.class +0 -0
  110. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$3.class +0 -0
  111. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$4.class +0 -0
  112. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$5.class +0 -0
  113. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$6.class +0 -0
  114. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$7.class +0 -0
  115. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$8.class +0 -0
  116. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$9.class +0 -0
  117. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$1.class +0 -0
  118. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$2.class +0 -0
  119. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$3.class +0 -0
  120. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$4.class +0 -0
  121. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$1.class +0 -0
  122. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$2.class +0 -0
  123. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule.class +0 -0
  124. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/FFT.class +0 -0
  125. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/Features.class +0 -0
  126. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/PermissionUtils.class +0 -0
  127. package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/RecordingConfig.class +0 -0
  128. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  129. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +1 -0
  130. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  131. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  132. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  133. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  134. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  135. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  136. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  137. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  138. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  139. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  140. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  141. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  142. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  143. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  144. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  145. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  146. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  147. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  148. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  149. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  150. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  151. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  152. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  153. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  154. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  155. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  156. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  157. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  158. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  159. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  160. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  161. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  162. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  163. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  164. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  165. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  166. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  167. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  168. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  169. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values +0 -0
  170. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  171. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.s +1 -0
  172. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  173. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  174. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  175. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  176. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  177. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  178. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  179. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  180. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  181. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  182. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  183. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  184. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  185. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  186. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  187. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  188. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  189. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  190. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  191. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  192. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  193. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  194. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  195. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
  196. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  197. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  198. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  199. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  200. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  201. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  202. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  203. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  204. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  205. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  206. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  207. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  208. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  209. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  210. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  211. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  212. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  213. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  214. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values +0 -0
  215. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  216. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.s +1 -0
  217. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  218. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  219. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  220. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  221. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  222. package/android/build/outputs/logs/manifest-merger-debug-report.txt +24 -0
  223. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  224. package/android/build/tmp/kotlin-classes/debug/META-INF/siteed-expo-audio-stream_debug.kotlin_module +0 -0
  225. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioAnalysisData$AmplitudeRange.class +0 -0
  226. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioAnalysisData$SpeakerChange.class +0 -0
  227. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioAnalysisData.class +0 -0
  228. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioDataEncoder.class +0 -0
  229. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioFileHandler.class +0 -0
  230. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioFormatUtils.class +0 -0
  231. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioProcessor$AudioData.class +0 -0
  232. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioProcessor$Companion.class +0 -0
  233. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioProcessor$extractMFCC$powerSpectrum$2.class +0 -0
  234. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioProcessor.class +0 -0
  235. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioRecorderManager.class +0 -0
  236. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/Constants.class +0 -0
  237. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/DataPoint.class +0 -0
  238. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/EventSender.class +0 -0
  239. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$1.class +0 -0
  240. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$10.class +0 -0
  241. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$11.class +0 -0
  242. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$12.class +0 -0
  243. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$13.class +0 -0
  244. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$14.class +0 -0
  245. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$15.class +0 -0
  246. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$16.class +0 -0
  247. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$17.class +0 -0
  248. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$18.class +0 -0
  249. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$2.class +0 -0
  250. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$3.class +0 -0
  251. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$4.class +0 -0
  252. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$5.class +0 -0
  253. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$6.class +0 -0
  254. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$7.class +0 -0
  255. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$8.class +0 -0
  256. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$9.class +0 -0
  257. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$1.class +0 -0
  258. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$2.class +0 -0
  259. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$3.class +0 -0
  260. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$4.class +0 -0
  261. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$1.class +0 -0
  262. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$2.class +0 -0
  263. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule.class +0 -0
  264. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/FFT.class +0 -0
  265. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/Features.class +0 -0
  266. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/PermissionUtils.class +0 -0
  267. package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/RecordingConfig.class +0 -0
  268. package/app.plugin.js +1 -0
  269. package/build/ExpoAudioStream.web.d.ts.map +1 -1
  270. package/build/ExpoAudioStream.web.js +1 -0
  271. package/build/ExpoAudioStream.web.js.map +1 -1
  272. package/build/WebRecorder.web.d.ts.map +1 -1
  273. package/build/WebRecorder.web.js +12 -2
  274. package/build/WebRecorder.web.js.map +1 -1
  275. package/build/utils/writeWavHeader.d.ts +43 -3
  276. package/build/utils/writeWavHeader.d.ts.map +1 -1
  277. package/build/utils/writeWavHeader.js +65 -19
  278. package/build/utils/writeWavHeader.js.map +1 -1
  279. package/expo-module.config.json +9 -0
  280. package/package.json +2 -22
  281. package/plugin/build/index.d.ts +5 -0
  282. package/plugin/build/index.js +28 -0
  283. package/plugin/src/index.ts +53 -0
  284. package/plugin/tsconfig.json +9 -0
  285. package/publish.sh +9 -0
  286. package/src/AudioAnalysis/AudioAnalysis.types.ts +84 -0
  287. package/src/AudioAnalysis/extractAudioAnalysis.ts +147 -0
  288. package/src/AudioAnalysis/extractWaveform.ts +25 -0
  289. package/src/AudioRecorder.provider.tsx +53 -0
  290. package/src/ExpoAudioStream.native.ts +6 -0
  291. package/src/ExpoAudioStream.types.ts +93 -0
  292. package/src/ExpoAudioStream.web.ts +256 -0
  293. package/src/ExpoAudioStreamModule.ts +31 -0
  294. package/src/WebRecorder.web.ts +448 -0
  295. package/src/constants.ts +18 -0
  296. package/src/events.ts +39 -0
  297. package/src/index.ts +24 -0
  298. package/src/logger.ts +22 -0
  299. package/src/useAudioRecorder.tsx +420 -0
  300. package/src/utils/BlobFix.ts +550 -0
  301. package/src/utils/concatenateBuffers.ts +24 -0
  302. package/src/utils/convertPCMToFloat32.ts +75 -0
  303. package/src/utils/encodingToBitDepth.ts +18 -0
  304. package/src/utils/getWavFileInfo.ts +132 -0
  305. package/src/utils/writeWavHeader.ts +114 -0
  306. package/src/workers/InlineFeaturesExtractor.web.tsx +312 -0
  307. package/src/workers/inlineAudioWebWorker.web.tsx +250 -0
  308. package/tsconfig.json +14 -0
@@ -0,0 +1,448 @@
1
+ // src/WebRecorder.ts
2
+ import { AudioAnalysis } from './AudioAnalysis/AudioAnalysis.types'
3
+ import { RecordingConfig } from './ExpoAudioStream.types'
4
+ import {
5
+ EmitAudioAnalysisFunction,
6
+ EmitAudioEventFunction,
7
+ } from './ExpoAudioStream.web'
8
+ import { getLogger } from './logger'
9
+ import { encodingToBitDepth } from './utils/encodingToBitDepth'
10
+ import { WavHeaderOptions, writeWavHeader } from './utils/writeWavHeader'
11
+ import { InlineFeaturesExtractor } from './workers/InlineFeaturesExtractor.web'
12
+ import { InlineAudioWebWorker } from './workers/inlineAudioWebWorker.web'
13
+
14
+ interface AudioWorkletEvent {
15
+ data: {
16
+ command: string
17
+ recordedData?: Float32Array
18
+ sampleRate?: number
19
+ }
20
+ }
21
+
22
+ interface AudioFeaturesEvent {
23
+ data: {
24
+ command: string
25
+ result: AudioAnalysis
26
+ }
27
+ }
28
+
29
+ const DEFAULT_WEB_BITDEPTH = 32
30
+ const DEFAULT_WEB_POINTS_PER_SECOND = 10
31
+ const DEFAULT_WEB_INTERVAL = 500
32
+ const DEFAULT_WEB_NUMBER_OF_CHANNELS = 1
33
+ const DEFAULT_ALGORITHM = 'rms'
34
+
35
+ const TAG = 'WebRecorder'
36
+ const logger = getLogger(TAG)
37
+
38
+ export class WebRecorder {
39
+ private audioContext: AudioContext
40
+ private audioWorkletNode!: AudioWorkletNode
41
+ private featureExtractorWorker?: Worker
42
+ private source: MediaStreamAudioSourceNode
43
+ private audioWorkletUrl: string
44
+ private emitAudioEventCallback: EmitAudioEventFunction
45
+ private emitAudioAnalysisCallback: EmitAudioAnalysisFunction
46
+ private config: RecordingConfig
47
+ private position: number // Track the cumulative position
48
+ private numberOfChannels: number // Number of audio channels
49
+ private bitDepth: number // Bit depth of the audio
50
+ private exportBitDepth: number // Bit depth of the audio
51
+ private buffer: Float32Array // Single buffer to store the audio data
52
+ private bufferSize: number // Keep track of the buffer size
53
+ private audioAnalysisData: AudioAnalysis // Keep updating the full audio analysis data with latest events
54
+
55
+ constructor({
56
+ audioContext,
57
+ source,
58
+ recordingConfig,
59
+ audioWorkletUrl,
60
+ emitAudioEventCallback,
61
+ emitAudioAnalysisCallback,
62
+ }: {
63
+ audioContext: AudioContext
64
+ source: MediaStreamAudioSourceNode
65
+ recordingConfig: RecordingConfig
66
+ audioWorkletUrl: string
67
+ emitAudioEventCallback: EmitAudioEventFunction
68
+ emitAudioAnalysisCallback: EmitAudioAnalysisFunction
69
+ }) {
70
+ this.audioContext = audioContext
71
+ this.source = source
72
+ this.audioWorkletUrl = audioWorkletUrl
73
+ this.emitAudioEventCallback = emitAudioEventCallback
74
+ this.emitAudioAnalysisCallback = emitAudioAnalysisCallback
75
+ this.config = recordingConfig
76
+ this.position = 0
77
+
78
+ const audioContextFormat = this.checkAudioContextFormat({
79
+ sampleRate: this.audioContext.sampleRate,
80
+ })
81
+ logger.debug('Initialized WebRecorder with config:', {
82
+ sampleRate: audioContextFormat.sampleRate,
83
+ bitDepth: audioContextFormat.bitDepth,
84
+ numberOfChannels: audioContextFormat.numberOfChannels,
85
+ })
86
+
87
+ this.bitDepth = audioContextFormat.bitDepth
88
+ this.numberOfChannels =
89
+ audioContextFormat.numberOfChannels ||
90
+ DEFAULT_WEB_NUMBER_OF_CHANNELS // Default to 1 if not available
91
+ this.exportBitDepth =
92
+ encodingToBitDepth({
93
+ encoding: recordingConfig.encoding ?? 'pcm_32bit',
94
+ }) ||
95
+ audioContextFormat.bitDepth ||
96
+ DEFAULT_WEB_BITDEPTH
97
+
98
+ // Initialize WAV header
99
+ const wavHeader = writeWavHeader({
100
+ sampleRate: this.audioContext.sampleRate,
101
+ numChannels: this.numberOfChannels,
102
+ bitDepth: this.exportBitDepth,
103
+ })
104
+
105
+ // Initialize the buffer with WAV header
106
+ this.buffer = new Float32Array(
107
+ wavHeader.byteLength / Float32Array.BYTES_PER_ELEMENT
108
+ )
109
+ this.bufferSize = this.buffer.byteLength
110
+
111
+ // Copy WAV header to Float32Array buffer
112
+ new Uint8Array(this.buffer.buffer).set(new Uint8Array(wavHeader))
113
+
114
+ this.audioAnalysisData = {
115
+ amplitudeRange: { min: 0, max: 0 },
116
+ dataPoints: [],
117
+ durationMs: 0,
118
+ samples: 0,
119
+ amplitudeAlgorithm: recordingConfig.algorithm || DEFAULT_ALGORITHM,
120
+ bitDepth: this.bitDepth,
121
+ numberOfChannels: this.numberOfChannels,
122
+ sampleRate: this.config.sampleRate || this.audioContext.sampleRate,
123
+ pointsPerSecond:
124
+ this.config.pointsPerSecond || DEFAULT_WEB_POINTS_PER_SECOND,
125
+ speakerChanges: [],
126
+ }
127
+
128
+ if (recordingConfig.enableProcessing) {
129
+ this.initFeatureExtractorWorker()
130
+ }
131
+ }
132
+
133
+ async init() {
134
+ try {
135
+ if (!this.audioWorkletUrl) {
136
+ const blob = new Blob([InlineAudioWebWorker], {
137
+ type: 'application/javascript',
138
+ })
139
+ const url = URL.createObjectURL(blob)
140
+ await this.audioContext.audioWorklet.addModule(url)
141
+ } else {
142
+ await this.audioContext.audioWorklet.addModule(
143
+ this.audioWorkletUrl
144
+ )
145
+ }
146
+ this.audioWorkletNode = new AudioWorkletNode(
147
+ this.audioContext,
148
+ 'recorder-processor'
149
+ )
150
+
151
+ this.audioWorkletNode.port.onmessage = async (
152
+ event: AudioWorkletEvent
153
+ ) => {
154
+ const command = event.data.command
155
+ if (command !== 'newData') {
156
+ return
157
+ }
158
+ // Handle the audio blob (e.g., send it to the server or process it further)
159
+ logger.debug('Received audio blob from processor', event)
160
+ const pcmBufferFloat = event.data.recordedData
161
+
162
+ if (!pcmBufferFloat) {
163
+ return
164
+ }
165
+
166
+ // Concatenate the incoming Float32Array to the existing buffer
167
+ const newBuffer = new Float32Array(
168
+ this.bufferSize + pcmBufferFloat.length
169
+ )
170
+ newBuffer.set(this.buffer, 0)
171
+ newBuffer.set(pcmBufferFloat, this.bufferSize)
172
+ this.buffer = newBuffer
173
+ this.bufferSize += pcmBufferFloat.length
174
+
175
+ const sampleRate =
176
+ event.data.sampleRate ?? this.audioContext.sampleRate
177
+ const duration = pcmBufferFloat.length / sampleRate // Calculate duration of the current buffer
178
+
179
+ this.emitAudioEventCallback({
180
+ data: pcmBufferFloat,
181
+ position: this.position,
182
+ })
183
+ this.position += duration // Update position
184
+
185
+ this.featureExtractorWorker?.postMessage(
186
+ {
187
+ command: 'process',
188
+ channelData: pcmBufferFloat,
189
+ sampleRate,
190
+ pointsPerSecond:
191
+ this.config.pointsPerSecond ||
192
+ DEFAULT_WEB_POINTS_PER_SECOND,
193
+ algorithm: this.config.algorithm || 'rms',
194
+ bitDepth: this.bitDepth,
195
+ fullAudioDurationMs: this.position * 1000,
196
+ numberOfChannels: this.numberOfChannels,
197
+ features: this.config.features,
198
+ },
199
+ []
200
+ )
201
+ }
202
+
203
+ logger.debug(
204
+ `WebRecorder initialized -- recordSampleRate=${this.audioContext.sampleRate}`,
205
+ this.config
206
+ )
207
+ this.audioWorkletNode.port.postMessage({
208
+ command: 'init',
209
+ recordSampleRate: this.audioContext.sampleRate, // Pass the original sample rate
210
+ exportSampleRate:
211
+ this.config.sampleRate ?? this.audioContext.sampleRate,
212
+ bitDepth: this.bitDepth,
213
+ exportBitDepth: this.exportBitDepth,
214
+ channels: this.numberOfChannels,
215
+ interval: this.config.interval ?? DEFAULT_WEB_INTERVAL,
216
+ })
217
+
218
+ // Connect the source to the AudioWorkletNode and start recording
219
+ this.source.connect(this.audioWorkletNode)
220
+ this.audioWorkletNode.connect(this.audioContext.destination)
221
+ } catch (error) {
222
+ console.error(`[${TAG}] Failed to initialize WebRecorder`, error)
223
+ }
224
+ }
225
+
226
+ initFeatureExtractorWorker(featuresExtratorUrl?: string) {
227
+ try {
228
+ if (featuresExtratorUrl) {
229
+ // Initialize the feature extractor worker
230
+ //TODO: create audio feature extractor from a Blob instead of url since we cannot include the url directly in the library
231
+ // We keep the url during dev and use the blob in production.
232
+ this.featureExtractorWorker = new Worker(
233
+ new URL(featuresExtratorUrl, window.location.href)
234
+ )
235
+ this.featureExtractorWorker.onmessage =
236
+ this.handleFeatureExtractorMessage.bind(this)
237
+ this.featureExtractorWorker.onerror =
238
+ this.handleWorkerError.bind(this)
239
+ } else {
240
+ // Fallback to the inline worker if the URL is not provided
241
+ this.initFallbackWorker()
242
+ }
243
+ } catch (error) {
244
+ console.error(
245
+ `[${TAG}] Failed to initialize feature extractor worker`,
246
+ error
247
+ )
248
+ this.initFallbackWorker()
249
+ }
250
+ }
251
+
252
+ initFallbackWorker() {
253
+ try {
254
+ const blob = new Blob([InlineFeaturesExtractor], {
255
+ type: 'application/javascript',
256
+ })
257
+ const url = URL.createObjectURL(blob)
258
+ this.featureExtractorWorker = new Worker(url)
259
+ this.featureExtractorWorker.onmessage =
260
+ this.handleFeatureExtractorMessage.bind(this)
261
+ this.featureExtractorWorker.onerror = (error) => {
262
+ console.error(`[${TAG}] Default Inline worker failed`, error)
263
+ }
264
+ logger.log('Inline worker initialized successfully')
265
+ } catch (error) {
266
+ console.error(
267
+ `[${TAG}] Failed to initialize Inline Feature Extractor worker`,
268
+ error
269
+ )
270
+ }
271
+ }
272
+
273
+ handleWorkerError(error: ErrorEvent) {
274
+ console.error(`[${TAG}] Feature extractor worker error:`, error)
275
+ }
276
+
277
+ handleFeatureExtractorMessage(event: AudioFeaturesEvent) {
278
+ if (event.data.command === 'features') {
279
+ const segmentResult = event.data.result
280
+
281
+ // Merge the segment result with the full audio analysis data
282
+ this.audioAnalysisData.dataPoints.push(...segmentResult.dataPoints)
283
+ this.audioAnalysisData.speakerChanges?.push(
284
+ ...(segmentResult.speakerChanges ?? [])
285
+ )
286
+ this.audioAnalysisData.durationMs = segmentResult.durationMs
287
+ if (segmentResult.amplitudeRange) {
288
+ this.audioAnalysisData.amplitudeRange = {
289
+ min: Math.min(
290
+ this.audioAnalysisData.amplitudeRange.min,
291
+ segmentResult.amplitudeRange.min
292
+ ),
293
+ max: Math.max(
294
+ this.audioAnalysisData.amplitudeRange.max,
295
+ segmentResult.amplitudeRange.max
296
+ ),
297
+ }
298
+ }
299
+ // Handle the extracted features (e.g., emit an event or log them)
300
+ logger.debug('features event segmentResult', segmentResult)
301
+ logger.debug(
302
+ 'features event audioAnalysisData',
303
+ this.audioAnalysisData
304
+ )
305
+ this.emitAudioAnalysisCallback(segmentResult)
306
+ }
307
+ }
308
+
309
+ start() {
310
+ this.source.connect(this.audioWorkletNode)
311
+ this.audioWorkletNode.connect(this.audioContext.destination)
312
+ }
313
+
314
+ stop(): Promise<Float32Array> {
315
+ return new Promise((resolve, reject) => {
316
+ try {
317
+ if (this.audioWorkletNode) {
318
+ // this.source.disconnect(this.audioWorkletNode);
319
+ // this.audioWorkletNode.disconnect(this.audioContext.destination);
320
+ this.audioWorkletNode.port.postMessage({ command: 'stop' })
321
+
322
+ // Set a timeout to reject the promise if no message is received within 5 seconds
323
+ const timeout = setTimeout(() => {
324
+ this.audioWorkletNode.port.removeEventListener(
325
+ 'message',
326
+ onMessage
327
+ )
328
+ reject(
329
+ new Error(
330
+ "Timeout error, audioWorkletNode didn't complete."
331
+ )
332
+ )
333
+ }, 5000)
334
+
335
+ // Listen for the recordedData message to confirm stopping
336
+ const onMessage = async (event: AudioWorkletEvent) => {
337
+ const command = event.data.command
338
+ if (command === 'recordedData') {
339
+ clearTimeout(timeout) // Clear the timeout
340
+
341
+ const rawPCMDataFull =
342
+ event.data.recordedData?.slice(0)
343
+
344
+ if (!rawPCMDataFull) {
345
+ reject(new Error('Failed to get recorded data'))
346
+ return
347
+ }
348
+
349
+ // Compute duration of the recorded data
350
+ const duration =
351
+ rawPCMDataFull.byteLength /
352
+ (this.audioContext.sampleRate *
353
+ (this.exportBitDepth /
354
+ this.numberOfChannels))
355
+ logger.debug(
356
+ `Received recorded data -- Duration: ${duration} vs ${rawPCMDataFull.byteLength / this.audioContext.sampleRate} seconds`
357
+ )
358
+ logger.debug(
359
+ `recordedData.length=${rawPCMDataFull.byteLength} vs transmittedData.length=${this.bufferSize}`
360
+ )
361
+
362
+ // Remove the event listener after receiving the final data
363
+ this.audioWorkletNode.port.removeEventListener(
364
+ 'message',
365
+ onMessage
366
+ )
367
+ resolve(this.buffer) // Resolve the promise with the collected buffers
368
+ }
369
+ }
370
+ this.audioWorkletNode.port.addEventListener(
371
+ 'message',
372
+ onMessage
373
+ )
374
+ }
375
+
376
+ // Stop all media stream tracks to stop the browser recording
377
+ this.stopMediaStreamTracks()
378
+ } catch (error) {
379
+ reject(error)
380
+ }
381
+ })
382
+ }
383
+
384
+ pause() {
385
+ this.source.disconnect(this.audioWorkletNode) // Disconnect the source from the AudioWorkletNode
386
+ this.audioWorkletNode.disconnect(this.audioContext.destination) // Disconnect the AudioWorkletNode from the destination
387
+ this.audioWorkletNode.port.postMessage({ command: 'pause' })
388
+ }
389
+
390
+ stopMediaStreamTracks() {
391
+ // Stop all audio tracks to stop the recording icon
392
+ const tracks = this.source.mediaStream.getTracks()
393
+ tracks.forEach((track) => track.stop())
394
+ }
395
+
396
+ async playRecordedData({
397
+ recordedData,
398
+ }: {
399
+ recordedData: ArrayBuffer
400
+ mimeType?: string
401
+ }) {
402
+ try {
403
+ const blob = new Blob([recordedData])
404
+ const url = URL.createObjectURL(blob)
405
+ const response = await fetch(url)
406
+ const arrayBuffer = await response.arrayBuffer()
407
+
408
+ // Decode the audio data
409
+ const audioBuffer =
410
+ await this.audioContext.decodeAudioData(arrayBuffer)
411
+
412
+ // Create a buffer source node and play the audio
413
+ const bufferSource = this.audioContext.createBufferSource()
414
+ bufferSource.buffer = audioBuffer
415
+ bufferSource.connect(this.audioContext.destination)
416
+ bufferSource.start()
417
+ logger.debug('Playing recorded data', recordedData)
418
+ } catch (error) {
419
+ console.error(`[${TAG}] Failed to play recorded data:`, error)
420
+ }
421
+ }
422
+
423
+ private checkAudioContextFormat({ sampleRate }: { sampleRate: number }) {
424
+ // Create a silent AudioBuffer
425
+ const frameCount = sampleRate * 1.0 // 1 second buffer
426
+ const audioBuffer = this.audioContext.createBuffer(
427
+ 1,
428
+ frameCount,
429
+ sampleRate
430
+ )
431
+
432
+ // Check the format
433
+ const channelData = audioBuffer.getChannelData(0)
434
+ const bitDepth = channelData.BYTES_PER_ELEMENT * 8 // 4 bytes per element means 32-bit
435
+
436
+ return {
437
+ sampleRate: audioBuffer.sampleRate,
438
+ bitDepth,
439
+ numberOfChannels: audioBuffer.numberOfChannels,
440
+ }
441
+ }
442
+
443
+ resume() {
444
+ this.source.connect(this.audioWorkletNode)
445
+ this.audioWorkletNode.connect(this.audioContext.destination)
446
+ this.audioWorkletNode.port.postMessage({ command: 'resume' })
447
+ }
448
+ }
@@ -0,0 +1,18 @@
1
+ // packages/expo-audio-stream/src/constants.ts
2
+ import { Platform } from 'react-native'
3
+
4
+ import { BitDepth, SampleRate } from './ExpoAudioStream.types'
5
+
6
+ export const isWeb = Platform.OS === 'web'
7
+ export const DEBUG_NAMESPACE = 'expo-audio-stream'
8
+
9
+ // Constants for identifying chunks in a WAV file
10
+ export const RIFF_HEADER = 0x52494646 // "RIFF"
11
+ export const WAVE_HEADER = 0x57415645 // "WAVE"
12
+ export const FMT_CHUNK_ID = 0x666d7420 // "fmt "
13
+ export const DATA_CHUNK_ID = 0x64617461 // "data"
14
+ export const INFO_CHUNK_ID = 0x494e464f // "INFO"
15
+
16
+ // Default values
17
+ export const DEFAULT_SAMPLE_RATE: SampleRate = 16000
18
+ export const DEFAULT_BIT_DEPTH: BitDepth = 32
package/src/events.ts ADDED
@@ -0,0 +1,39 @@
1
+ // packages/expo-audio-stream/src/events.ts
2
+
3
+ import { EventEmitter, type Subscription } from 'expo-modules-core'
4
+
5
+ import { AudioAnalysis } from './AudioAnalysis/AudioAnalysis.types'
6
+ import ExpoAudioStreamModule from './ExpoAudioStreamModule'
7
+ import { getLogger } from './logger'
8
+
9
+ const emitter = new EventEmitter(ExpoAudioStreamModule)
10
+ const logger = getLogger('events')
11
+
12
+ export interface AudioEventPayload {
13
+ encoded?: string
14
+ buffer?: Float32Array
15
+ fileUri: string
16
+ lastEmittedSize: number
17
+ position: number
18
+ deltaSize: number
19
+ totalSize: number
20
+ mimeType: string
21
+ streamUuid: string
22
+ }
23
+
24
+ export function addAudioEventListener(
25
+ listener: (event: AudioEventPayload) => Promise<void>
26
+ ): Subscription {
27
+ logger.log('Adding listener for AudioData event')
28
+ return emitter.addListener<AudioEventPayload>('AudioData', listener)
29
+ }
30
+
31
+ // Only aliasing the AudioAnalysis type for the event payload
32
+ export interface AudioAnalysisEvent extends AudioAnalysis {}
33
+
34
+ export function addAudioAnalysisListener(
35
+ listener: (event: AudioAnalysisEvent) => Promise<void>
36
+ ): Subscription {
37
+ logger.log('Adding listener for AudioAnalysis event')
38
+ return emitter.addListener<AudioAnalysisEvent>('AudioAnalysis', listener)
39
+ }
package/src/index.ts ADDED
@@ -0,0 +1,24 @@
1
+ // src/index.ts
2
+
3
+ import { extractAudioAnalysis } from './AudioAnalysis/extractAudioAnalysis'
4
+ import {
5
+ AudioRecorderProvider,
6
+ useSharedAudioRecorder,
7
+ } from './AudioRecorder.provider'
8
+ import ExpoAudioStreamModule from './ExpoAudioStreamModule'
9
+ import { useAudioRecorder } from './useAudioRecorder'
10
+
11
+ export * from './utils/convertPCMToFloat32'
12
+ export * from './utils/getWavFileInfo'
13
+ export * from './utils/writeWavHeader'
14
+
15
+ export {
16
+ AudioRecorderProvider,
17
+ ExpoAudioStreamModule,
18
+ extractAudioAnalysis,
19
+ useAudioRecorder,
20
+ useSharedAudioRecorder,
21
+ }
22
+
23
+ export type * from './AudioAnalysis/AudioAnalysis.types'
24
+ export type * from './ExpoAudioStream.types'
package/src/logger.ts ADDED
@@ -0,0 +1,22 @@
1
+ // packages/expo-audio-stream/src/logger.ts
2
+ import { getLogger as siteedGetLogger } from '@siteed/react-native-logger'
3
+
4
+ import { DEBUG_NAMESPACE } from './constants'
5
+
6
+ type ConsoleLike = {
7
+ log: (message: string, ...args: unknown[]) => void
8
+ debug: (message: string, ...args: unknown[]) => void
9
+ warn: (message: string, ...args: unknown[]) => void
10
+ error: (message: string, ...args: unknown[]) => void
11
+ }
12
+
13
+ export const getLogger = (tag: string): ConsoleLike => {
14
+ const baseLogger = siteedGetLogger(`${DEBUG_NAMESPACE}:${tag}`)
15
+
16
+ return {
17
+ log: (...args: unknown[]) => baseLogger.log(...(args as [unknown])),
18
+ debug: (...args: unknown[]) => baseLogger.debug(...(args as [unknown])),
19
+ error: (...args: unknown[]) => baseLogger.error(...(args as [unknown])),
20
+ warn: (...args: unknown[]) => baseLogger.warn(...(args as [unknown])),
21
+ }
22
+ }