@siteed/expo-audio-stream 1.1.5 → 1.1.6

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 (298) 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/expo-module.config.json +9 -0
  270. package/package.json +1 -21
  271. package/plugin/build/index.d.ts +5 -0
  272. package/plugin/build/index.js +28 -0
  273. package/plugin/src/index.ts +53 -0
  274. package/plugin/tsconfig.json +9 -0
  275. package/publish.sh +8 -0
  276. package/src/AudioAnalysis/AudioAnalysis.types.ts +84 -0
  277. package/src/AudioAnalysis/extractAudioAnalysis.ts +147 -0
  278. package/src/AudioAnalysis/extractWaveform.ts +25 -0
  279. package/src/AudioRecorder.provider.tsx +53 -0
  280. package/src/ExpoAudioStream.native.ts +6 -0
  281. package/src/ExpoAudioStream.types.ts +93 -0
  282. package/src/ExpoAudioStream.web.ts +255 -0
  283. package/src/ExpoAudioStreamModule.ts +31 -0
  284. package/src/WebRecorder.web.ts +433 -0
  285. package/src/constants.ts +18 -0
  286. package/src/events.ts +39 -0
  287. package/src/index.ts +24 -0
  288. package/src/logger.ts +22 -0
  289. package/src/useAudioRecorder.tsx +420 -0
  290. package/src/utils/BlobFix.ts +550 -0
  291. package/src/utils/concatenateBuffers.ts +24 -0
  292. package/src/utils/convertPCMToFloat32.ts +75 -0
  293. package/src/utils/encodingToBitDepth.ts +18 -0
  294. package/src/utils/getWavFileInfo.ts +132 -0
  295. package/src/utils/writeWavHeader.ts +61 -0
  296. package/src/workers/InlineFeaturesExtractor.web.tsx +312 -0
  297. package/src/workers/inlineAudioWebWorker.web.tsx +250 -0
  298. package/tsconfig.json +14 -0
@@ -0,0 +1,250 @@
1
+ export const InlineAudioWebWorker = `
2
+ const DEFAULT_BIT_DEPTH = 32
3
+ const DEFAULT_SAMPLE_RATE = 44100
4
+
5
+ class RecorderProcessor extends AudioWorkletProcessor {
6
+ constructor() {
7
+ super()
8
+ this.recordedBuffers = [] // Float32Array
9
+ this.newRecBuffer = [] // Float32Array
10
+ this.resampledBuffer = [] // Float32Array
11
+ this.exportIntervalSamples = 0
12
+ this.samplesSinceLastExport = 0
13
+ this.recordSampleRate = DEFAULT_SAMPLE_RATE // To be overwritten
14
+ this.exportSampleRate = DEFAULT_SAMPLE_RATE // To be overwritten
15
+ this.recordBitDepth = DEFAULT_BIT_DEPTH // Default to 32-bit depth
16
+ this.exportBitDepth = DEFAULT_BIT_DEPTH // To be overwritten
17
+ this.numberOfChannels = 1 // Default to 1 channel (mono)
18
+ this.isRecording = true
19
+ this.port.onmessage = this.handleMessage.bind(this)
20
+ }
21
+
22
+ handleMessage(event) {
23
+ switch (event.data.command) {
24
+ case 'init':
25
+ this.recordSampleRate = event.data.recordSampleRate
26
+ this.exportSampleRate =
27
+ event.data.exportSampleRate || event.data.recordSampleRate
28
+ this.exportIntervalSamples =
29
+ this.recordSampleRate * (event.data.interval / 1000)
30
+ if (event.data.numberOfChannels) {
31
+ this.numberOfChannels = event.data.numberOfChannels
32
+ }
33
+ if (event.data.recordBitDepth) {
34
+ this.recordBitDepth = event.data.recordBitDepth
35
+ }
36
+ this.exportBitDepth =
37
+ event.data.exportBitDepth ||
38
+ this.recordBitDepth ||
39
+ DEFAULT_BIT_DEPTH
40
+ break
41
+ case 'stop':
42
+ this.isRecording = false
43
+ this.getAllRecordedData()
44
+ .then((fullRecordedData) => {
45
+ this.port.postMessage({
46
+ command: 'recordedData',
47
+ recordedData: fullRecordedData,
48
+ bitDepth: this.exportBitDepth,
49
+ sampleRate: this.exportSampleRate,
50
+ })
51
+ return fullRecordedData
52
+ })
53
+ .catch((error) => {
54
+ console.error(
55
+ 'RecorderProcessor Error extracting recorded data:',
56
+ error
57
+ )
58
+ })
59
+ break
60
+ }
61
+ }
62
+
63
+ process(inputs, _outputs, _parameters) {
64
+ if (!this.isRecording) return true
65
+ const input = inputs[0]
66
+ if (input.length > 0) {
67
+ const newBuffer = new Float32Array(input[0])
68
+ this.newRecBuffer.push(newBuffer)
69
+ this.recordedBuffers.push(newBuffer)
70
+ this.samplesSinceLastExport += newBuffer.length
71
+
72
+ if (this.samplesSinceLastExport >= this.exportIntervalSamples) {
73
+ this.exportNewData()
74
+ this.samplesSinceLastExport = 0
75
+ }
76
+ }
77
+ return true
78
+ }
79
+
80
+ mergeBuffers(bufferArray, recLength) {
81
+ const result = new Float32Array(recLength)
82
+ let offset = 0
83
+ for (let i = 0; i < bufferArray.length; i++) {
84
+ result.set(bufferArray[i], offset)
85
+ offset += bufferArray[i].length
86
+ }
87
+ return result
88
+ }
89
+
90
+ floatTo16BitPCM(input) {
91
+ const output = new Int16Array(input.length)
92
+ for (let i = 0; i < input.length; i++) {
93
+ const s = Math.max(-1, Math.min(1, input[i]))
94
+ output[i] = s < 0 ? s * 0x8000 : s * 0x7fff
95
+ }
96
+ console.debug(
97
+ 'RecorderProcessor Float to 16-bit PCM conversion complete. Output byte length:',
98
+ output.byteLength
99
+ )
100
+ return output
101
+ }
102
+
103
+ floatTo32BitPCM(input) {
104
+ const output = new Int32Array(input.length)
105
+ for (let i = 0; i < input.length; i++) {
106
+ const s = Math.max(-1, Math.min(1, input[i]))
107
+ output[i] = s < 0 ? s * 0x80000000 : s * 0x7fffffff
108
+ }
109
+ console.debug(
110
+ 'RecorderProcessor Float to 32-bit PCM conversion complete. Output byte length:',
111
+ output.byteLength
112
+ )
113
+ return output
114
+ }
115
+
116
+ resample(samples, targetSampleRate) {
117
+ if (this.recordSampleRate === targetSampleRate) {
118
+ return samples
119
+ }
120
+ const resampledBuffer = new Float32Array(
121
+ (samples.length * targetSampleRate) / this.recordSampleRate
122
+ )
123
+ const ratio = this.recordSampleRate / targetSampleRate
124
+ let offset = 0
125
+ for (let i = 0; i < resampledBuffer.length; i++) {
126
+ const nextOffset = Math.floor((i + 1) * ratio)
127
+ let accum = 0
128
+ let count = 0
129
+ for (let j = offset; j < nextOffset && j < samples.length; j++) {
130
+ accum += samples[j]
131
+ count++
132
+ }
133
+ resampledBuffer[i] = accum / count
134
+ offset = nextOffset
135
+ }
136
+ return resampledBuffer
137
+ }
138
+
139
+ async resampleBuffer(buffer, targetSampleRate) {
140
+ if (typeof OfflineAudioContext === 'undefined') {
141
+ return this.resample(buffer, targetSampleRate)
142
+ }
143
+
144
+ if (this.recordSampleRate === targetSampleRate) {
145
+ return buffer
146
+ }
147
+ const offlineContext = new OfflineAudioContext(
148
+ this.numberOfChannels,
149
+ buffer.length,
150
+ this.recordSampleRate
151
+ )
152
+ const sourceBuffer = offlineContext.createBuffer(
153
+ this.numberOfChannels,
154
+ buffer.length,
155
+ this.recordSampleRate
156
+ )
157
+ sourceBuffer.copyToChannel(buffer, 0)
158
+
159
+ const bufferSource = offlineContext.createBufferSource()
160
+ bufferSource.buffer = sourceBuffer
161
+ bufferSource.connect(offlineContext.destination)
162
+ bufferSource.start()
163
+
164
+ const renderedBuffer = await offlineContext.startRendering()
165
+
166
+ const resampledBuffer = new Float32Array(renderedBuffer.length)
167
+ renderedBuffer.copyFromChannel(resampledBuffer, 0)
168
+
169
+ return resampledBuffer
170
+ }
171
+
172
+ async exportNewData() {
173
+ // Calculate the total length of the new recorded buffers
174
+ const length = this.newRecBuffer.reduce(
175
+ (acc, buffer) => acc + buffer.length,
176
+ 0
177
+ )
178
+
179
+ // Merge all new recorded buffers into a single buffer
180
+ const mergedBuffer = this.mergeBuffers(this.newRecBuffer, length)
181
+
182
+ const resampledBuffer = await this.resampleBuffer(
183
+ mergedBuffer,
184
+ this.exportSampleRate
185
+ )
186
+
187
+ let finalBuffer = resampledBuffer // Float32Array
188
+ if (this.recordBitDepth !== this.exportBitDepth) {
189
+ if (this.exportBitDepth === 16) {
190
+ finalBuffer = this.floatTo16BitPCM(resampledBuffer)
191
+ } else if (this.exportBitDepth === 32) {
192
+ finalBuffer = this.floatTo32BitPCM(resampledBuffer)
193
+ }
194
+ }
195
+
196
+ const originalSize = mergedBuffer.byteLength
197
+ const resampledSize = resampledBuffer.byteLength
198
+ const finalSize = finalBuffer.byteLength
199
+
200
+ // Clear the new recorded buffers after they have been processed
201
+ this.newRecBuffer.length = 0
202
+
203
+ // Post the message to the main thread
204
+ // The first argument is the message data, containing the encoded WAV buffer
205
+ // The second argument is the transfer list, which transfers ownership of the ArrayBuffer
206
+ // to the main thread, avoiding the need to copy the buffer and improving performance
207
+ // this.port.postMessage({ recordedData: encodedWav.buffer, sampleRate: this.recordSampleRate }, [encodedWav.buffer]);
208
+ this.port.postMessage(
209
+ {
210
+ command: 'newData',
211
+ recordedData: finalBuffer,
212
+ sampleRate: this.exportSampleRate,
213
+ bitDepth: this.exportBitDepth,
214
+ },
215
+ []
216
+ )
217
+ }
218
+
219
+ async getAllRecordedData() {
220
+ const length = this.recordedBuffers.reduce(
221
+ (acc, buffer) => acc + buffer.length,
222
+ 0
223
+ )
224
+ const mergedBuffer = this.mergeBuffers(this.recordedBuffers, length)
225
+ const resampledBuffer = await this.resampleBuffer(
226
+ mergedBuffer,
227
+ this.exportSampleRate
228
+ )
229
+ // Convert to the desired bit depth if necessary
230
+ let finalBuffer = resampledBuffer
231
+ if (this.recordBitDepth !== this.exportBitDepth) {
232
+ if (this.exportBitDepth === 16) {
233
+ finalBuffer = this.floatTo16BitPCM(resampledBuffer)
234
+ } else if (this.exportBitDepth === 32) {
235
+ finalBuffer = this.floatTo32BitPCM(resampledBuffer)
236
+ }
237
+ }
238
+
239
+ const originalSize = mergedBuffer.byteLength
240
+ const resampledSize = resampledBuffer.byteLength
241
+ const finalSize = finalBuffer.byteLength
242
+
243
+ this.recordedBuffers.length = 0 // Clear the buffers after extraction
244
+
245
+ return finalBuffer
246
+ }
247
+ }
248
+
249
+ registerProcessor('recorder-processor', RecorderProcessor)
250
+ `
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "expo-module-scripts/tsconfig.base",
3
+ "compilerOptions": {
4
+ "outDir": "./build",
5
+ "types": ["jest", "node"],
6
+ "sourceMap": true,
7
+ "typeRoots": [
8
+ "./node_modules/@types",
9
+ "../../node_modules/@types",
10
+ ],
11
+ },
12
+ "include": ["./src"],
13
+ "exclude": ["**/__mocks__/*", "**/__tests__/*"]
14
+ }