@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,132 @@
1
+ // packages/expo-audio-stream/src/utils/getWavFileInfo.ts
2
+
3
+ import { BitDepth, SampleRate } from '../ExpoAudioStream.types'
4
+ import {
5
+ DATA_CHUNK_ID,
6
+ DEFAULT_BIT_DEPTH,
7
+ DEFAULT_SAMPLE_RATE,
8
+ FMT_CHUNK_ID,
9
+ INFO_CHUNK_ID,
10
+ RIFF_HEADER,
11
+ WAVE_HEADER,
12
+ } from '../constants'
13
+
14
+ // Audio format descriptions
15
+ const AUDIO_FORMATS: { [key: number]: string } = {
16
+ 1: 'PCM',
17
+ 3: 'IEEE float',
18
+ 6: '8-bit ITU-T G.711 A-law',
19
+ 7: '8-bit ITU-T G.711 µ-law',
20
+ 65534: 'WAVE_FORMAT_EXTENSIBLE',
21
+ }
22
+
23
+ /**
24
+ * Interface representing the metadata of a WAV file.
25
+ */
26
+ export interface WavFileInfo {
27
+ sampleRate: SampleRate
28
+ numChannels: number
29
+ bitDepth: BitDepth
30
+ size: number // in bytes
31
+ durationMs: number // in ms
32
+ audioFormatDescription: string // Description of the audio format
33
+ byteRate: number // Average bytes per second
34
+ blockAlign: number // Number of bytes for one sample including all channels
35
+ creationDateTime?: string // Optional creation date and time
36
+ comments?: string // Optional comments or tags
37
+ compressionType?: string // Optional compression type
38
+ dataChunkOffset: number // Position of the first data chunk
39
+ }
40
+
41
+ /**
42
+ * Extracts metadata from a WAV buffer.
43
+ *
44
+ * @param arrayBuffer - The array buffer containing the WAV data.
45
+ * @returns A promise that resolves to the extracted metadata.
46
+ */
47
+ export const getWavFileInfo = async (
48
+ arrayBuffer: ArrayBuffer
49
+ ): Promise<WavFileInfo> => {
50
+ const view = new DataView(arrayBuffer)
51
+
52
+ // Check if the file is a valid RIFF/WAVE file
53
+ const riffHeader = view.getUint32(0, false)
54
+ const waveHeader = view.getUint32(8, false)
55
+ if (riffHeader !== RIFF_HEADER || waveHeader !== WAVE_HEADER) {
56
+ throw new Error('Invalid WAV file')
57
+ }
58
+
59
+ // Initialize variables for the metadata
60
+ let fmtChunkOffset = 12
61
+ let sampleRate: SampleRate = DEFAULT_SAMPLE_RATE
62
+ let numChannels = 0
63
+ let bitDepth: BitDepth = DEFAULT_BIT_DEPTH
64
+ let dataChunkSize = 0
65
+ let audioFormat = 0
66
+ let byteRate = 0
67
+ let blockAlign = 0
68
+ let creationDateTime = ''
69
+ let comments = ''
70
+ let dataChunkOffset = 0
71
+
72
+ // Parse chunks to find the "fmt " and "data" chunks
73
+ while (fmtChunkOffset < view.byteLength) {
74
+ const chunkId = view.getUint32(fmtChunkOffset, false)
75
+ const chunkSize = view.getUint32(fmtChunkOffset + 4, true)
76
+ if (chunkId === FMT_CHUNK_ID) {
77
+ // "fmt "
78
+ audioFormat = view.getUint16(fmtChunkOffset + 8, true)
79
+ if (!AUDIO_FORMATS[audioFormat]) {
80
+ throw new Error('Unsupported WAV file format')
81
+ }
82
+ numChannels = view.getUint16(fmtChunkOffset + 10, true)
83
+ sampleRate = view.getUint32(fmtChunkOffset + 12, true) as SampleRate
84
+ byteRate = view.getUint32(fmtChunkOffset + 16, true)
85
+ blockAlign = view.getUint16(fmtChunkOffset + 20, true)
86
+ bitDepth = view.getUint16(fmtChunkOffset + 22, true) as BitDepth
87
+ } else if (chunkId === DATA_CHUNK_ID) {
88
+ // "data"
89
+ dataChunkSize = chunkSize
90
+ dataChunkOffset = fmtChunkOffset + 8 // Position after chunk header
91
+ break
92
+ } else if (chunkId === INFO_CHUNK_ID) {
93
+ // "INFO"
94
+ // Read INFO chunk (assuming it contains a text-based creation date/time and comments)
95
+ const infoStart = fmtChunkOffset + 8
96
+ const infoText = new TextDecoder().decode(
97
+ new Uint8Array(
98
+ arrayBuffer.slice(infoStart, infoStart + chunkSize)
99
+ )
100
+ )
101
+ const infoParts = infoText.split('\0')
102
+ creationDateTime = infoParts[0]
103
+ comments = infoParts[1]
104
+ }
105
+ fmtChunkOffset += 8 + chunkSize
106
+ }
107
+
108
+ if (!sampleRate || !numChannels || !bitDepth || !dataChunkSize) {
109
+ throw new Error('Incomplete WAV file information')
110
+ }
111
+
112
+ // Calculate duration
113
+ const bytesPerSample = bitDepth / 8
114
+ const numSamples = dataChunkSize / (numChannels * bytesPerSample)
115
+ const durationMs = (numSamples / sampleRate) * 1000
116
+
117
+ return {
118
+ sampleRate,
119
+ numChannels,
120
+ bitDepth,
121
+ size: arrayBuffer.byteLength,
122
+ durationMs,
123
+ audioFormatDescription: AUDIO_FORMATS[audioFormat],
124
+ byteRate,
125
+ blockAlign,
126
+ creationDateTime: creationDateTime || undefined,
127
+ comments: comments || undefined,
128
+ compressionType:
129
+ audioFormat === 1 ? 'None' : AUDIO_FORMATS[audioFormat],
130
+ dataChunkOffset,
131
+ }
132
+ }
@@ -0,0 +1,114 @@
1
+ // packages/expo-audio-stream/src/utils/writeWavHeader.ts
2
+
3
+ /**
4
+ * Options for creating a WAV header.
5
+ */
6
+ export interface WavHeaderOptions {
7
+ /** Optional buffer containing audio data. If provided, it will be combined with the header. */
8
+ buffer?: ArrayBuffer
9
+ /** The sample rate of the audio in Hz (e.g., 44100). */
10
+ sampleRate: number
11
+ /** The number of audio channels (e.g., 1 for mono, 2 for stereo). */
12
+ numChannels: number
13
+ /** The bit depth of the audio (e.g., 16, 24, or 32). */
14
+ bitDepth: number
15
+ }
16
+
17
+ /**
18
+ * Writes or updates a WAV (RIFF) header based on the provided options.
19
+ *
20
+ * This function can be used in three ways:
21
+ * 1. To create a standalone WAV header (when no buffer is provided).
22
+ * 2. To create a WAV header and combine it with existing audio data (when a buffer without a header is provided).
23
+ * 3. To update an existing WAV header in the provided buffer.
24
+ *
25
+ * For streaming audio where the final size is unknown, this function sets the size fields
26
+ * to the maximum 32-bit value (0xFFFFFFFF). These can be updated later using the
27
+ * `updateWavHeaderSize` function once the final size is known.
28
+ *
29
+ * @param options - The options for creating or updating the WAV header.
30
+ * @returns An ArrayBuffer containing the WAV header, or the header combined with the provided audio data.
31
+ *
32
+ * @throws {Error} Throws an error if the provided options are invalid or if the buffer is too small.
33
+ *
34
+ * @example
35
+ * // Create a standalone WAV header
36
+ * const header = writeWavHeader({
37
+ * sampleRate: 44100,
38
+ * numChannels: 2,
39
+ * bitDepth: 16
40
+ * });
41
+ *
42
+ * @example
43
+ * // Create a WAV header and combine it with audio data
44
+ * const completeWav = writeWavHeader({
45
+ * buffer: audioData,
46
+ * sampleRate: 44100,
47
+ * numChannels: 2,
48
+ * bitDepth: 16
49
+ * });
50
+ */
51
+ export const writeWavHeader = ({
52
+ buffer,
53
+ sampleRate,
54
+ numChannels,
55
+ bitDepth,
56
+ }: WavHeaderOptions): ArrayBuffer => {
57
+ const bytesPerSample = bitDepth / 8
58
+ const blockAlign = numChannels * bytesPerSample
59
+ const byteRate = sampleRate * blockAlign
60
+
61
+ // Function to write a string to the DataView
62
+ const writeString = (view: DataView, offset: number, string: string) => {
63
+ for (let i = 0; i < string.length; i++) {
64
+ view.setUint8(offset + i, string.charCodeAt(i))
65
+ }
66
+ }
67
+
68
+ // Function to write or update the header
69
+ const writeHeader = (view: DataView, dataSize: number = 0xffffffff) => {
70
+ writeString(view, 0, 'RIFF') // ChunkID
71
+ view.setUint32(4, 36 + dataSize, true) // ChunkSize
72
+ writeString(view, 8, 'WAVE') // Format
73
+ writeString(view, 12, 'fmt ') // Subchunk1ID
74
+ view.setUint32(16, 16, true) // Subchunk1Size (16 for PCM)
75
+ view.setUint16(20, bitDepth === 32 ? 3 : 1, true) // AudioFormat (3 for float, 1 for PCM)
76
+ view.setUint16(22, numChannels, true) // NumChannels
77
+ view.setUint32(24, sampleRate, true) // SampleRate
78
+ view.setUint32(28, byteRate, true) // ByteRate
79
+ view.setUint16(32, blockAlign, true) // BlockAlign
80
+ view.setUint16(34, bitDepth, true) // BitsPerSample
81
+ writeString(view, 36, 'data') // Subchunk2ID
82
+ view.setUint32(40, dataSize, true) // Subchunk2Size
83
+ }
84
+
85
+ if (buffer) {
86
+ if (buffer.byteLength < 44) {
87
+ throw new Error('Buffer is too small to contain a valid WAV header')
88
+ }
89
+
90
+ const view = new DataView(buffer)
91
+
92
+ // Check if the buffer already has a WAV header by looking for "RIFF" at the start
93
+ const existingHeader = view.getUint32(0, false) === 0x52494646 // "RIFF" in ASCII
94
+
95
+ if (existingHeader) {
96
+ // Update the existing header
97
+ writeHeader(view, buffer.byteLength - 44)
98
+ return buffer
99
+ } else {
100
+ // Combine the new header with the existing buffer
101
+ const newBuffer = new ArrayBuffer(44 + buffer.byteLength)
102
+ const newView = new DataView(newBuffer)
103
+ writeHeader(newView, buffer.byteLength)
104
+ new Uint8Array(newBuffer).set(new Uint8Array(buffer), 44)
105
+ return newBuffer
106
+ }
107
+ } else {
108
+ // Create a standalone header
109
+ const headerBuffer = new ArrayBuffer(44)
110
+ const view = new DataView(headerBuffer)
111
+ writeHeader(view)
112
+ return headerBuffer
113
+ }
114
+ }
@@ -0,0 +1,312 @@
1
+ export const InlineFeaturesExtractor = `
2
+ // Unique ID counter
3
+ let uniqueIdCounter = 0
4
+
5
+ self.onmessage = function (event) {
6
+ const {
7
+ channelData, // this is only the newly recorded data when live recording.
8
+ sampleRate,
9
+ pointsPerSecond,
10
+ algorithm,
11
+ bitDepth,
12
+ fullAudioDurationMs,
13
+ numberOfChannels,
14
+ features: _features,
15
+ } = event.data
16
+
17
+ console.log('[AudioFeaturesExtractor] Worker received message', event.data)
18
+ const features = _features || {}
19
+
20
+ const SILENCE_THRESHOLD = 0.01
21
+ const MIN_SILENCE_DURATION = 1.5 * sampleRate // 1.5 seconds of silence
22
+ const SPEECH_INERTIA_DURATION = 0.1 * sampleRate // Speech inertia duration in samples
23
+ const RMS_THRESHOLD = 0.01
24
+ const ZCR_THRESHOLD = 0.1
25
+
26
+ // Placeholder functions for feature extraction
27
+ const extractMFCC = (segmentData, sampleRate) => {
28
+ // Implement MFCC extraction logic here
29
+ return []
30
+ }
31
+
32
+ const extractSpectralCentroid = (segmentData, sampleRate) => {
33
+ const magnitudeSpectrum = segmentData.map((v) => v * v)
34
+ const sum = magnitudeSpectrum.reduce((a, b) => a + b, 0)
35
+ if (sum === 0) return 0
36
+
37
+ const weightedSum = magnitudeSpectrum.reduce(
38
+ (acc, value, index) => acc + index * value,
39
+ 0
40
+ )
41
+ return (
42
+ ((weightedSum / sum) * (sampleRate / 2)) / magnitudeSpectrum.length
43
+ )
44
+ }
45
+
46
+ const extractSpectralFlatness = (segmentData) => {
47
+ const magnitudeSpectrum = segmentData.map((v) => Math.abs(v))
48
+ const geometricMean = Math.exp(
49
+ magnitudeSpectrum
50
+ .map((v) => Math.log(v + Number.MIN_VALUE))
51
+ .reduce((a, b) => a + b) / magnitudeSpectrum.length
52
+ )
53
+ const arithmeticMean =
54
+ magnitudeSpectrum.reduce((a, b) => a + b) / magnitudeSpectrum.length
55
+ return arithmeticMean === 0 ? 0 : geometricMean / arithmeticMean
56
+ }
57
+
58
+ const extractSpectralRollOff = (segmentData, sampleRate) => {
59
+ const magnitudeSpectrum = segmentData.map((v) => Math.abs(v))
60
+ const totalEnergy = magnitudeSpectrum.reduce((a, b) => a + b, 0)
61
+ const rollOffThreshold = totalEnergy * 0.85
62
+ let cumulativeEnergy = 0
63
+
64
+ for (let i = 0; i < magnitudeSpectrum.length; i++) {
65
+ cumulativeEnergy += magnitudeSpectrum[i]
66
+ if (cumulativeEnergy >= rollOffThreshold) {
67
+ return (i / magnitudeSpectrum.length) * (sampleRate / 2)
68
+ }
69
+ }
70
+
71
+ return 0
72
+ }
73
+
74
+ const extractSpectralBandwidth = (segmentData, sampleRate) => {
75
+ const centroid = extractSpectralCentroid(segmentData, sampleRate)
76
+ const magnitudeSpectrum = segmentData.map((v) => Math.abs(v))
77
+ const sum = magnitudeSpectrum.reduce((a, b) => a + b, 0)
78
+ if (sum === 0) return 0
79
+
80
+ const weightedSum = magnitudeSpectrum.reduce(
81
+ (acc, value, index) => acc + value * Math.pow(index - centroid, 2),
82
+ 0
83
+ )
84
+ return Math.sqrt(weightedSum / sum)
85
+ }
86
+
87
+ const extractChromagram = (segmentData, sampleRate) => {
88
+ return [] // TODO implement
89
+ }
90
+
91
+ const extractHNR = (segmentData) => {
92
+ const frameSize = segmentData.length
93
+ const autocorrelation = new Float32Array(frameSize)
94
+
95
+ // Compute the autocorrelation of the segment data
96
+ for (let i = 0; i < frameSize; i++) {
97
+ let sum = 0
98
+ for (let j = 0; j < frameSize - i; j++) {
99
+ sum += segmentData[j] * segmentData[j + i]
100
+ }
101
+ autocorrelation[i] = sum
102
+ }
103
+
104
+ // Find the maximum autocorrelation value (excluding the zero lag)
105
+ const maxAutocorrelation = Math.max(...autocorrelation.subarray(1))
106
+
107
+ // Compute the HNR
108
+ return autocorrelation[0] !== 0
109
+ ? 10 *
110
+ Math.log10(
111
+ maxAutocorrelation /
112
+ (autocorrelation[0] - maxAutocorrelation)
113
+ )
114
+ : 0
115
+ }
116
+
117
+ const extractWaveform = (
118
+ channelData, // Float32Array
119
+ sampleRate, // number
120
+ pointsPerSecond, // number
121
+ algorithm // string
122
+ ) => {
123
+ const totalSamples = channelData.length
124
+ const segmentDuration = totalSamples / sampleRate
125
+ const totalPoints = Math.max(
126
+ Math.ceil(segmentDuration * pointsPerSecond),
127
+ 1
128
+ )
129
+ const pointInterval = Math.ceil(totalSamples / totalPoints)
130
+ const dataPoints = []
131
+ let minAmplitude = Infinity
132
+ let maxAmplitude = -Infinity
133
+ let silenceStart = null
134
+ let lastSpeechEnd = -Infinity
135
+ let isSpeech = false
136
+
137
+ const expectedPoints = segmentDuration * pointsPerSecond
138
+ const samplesPerPoint = Math.ceil(channelData.length / expectedPoints)
139
+
140
+ for (let i = 0; i < expectedPoints; i++) {
141
+ const start = i * samplesPerPoint
142
+ const end = Math.min(start + samplesPerPoint, totalSamples)
143
+
144
+ let sumSquares = 0
145
+ let zeroCrossings = 0
146
+ let prevValue = channelData[start]
147
+ let localMinAmplitude = Infinity
148
+ let localMaxAmplitude = -Infinity
149
+ let hasNonZeroValue = false
150
+
151
+ // compute values for the segment
152
+ for (let j = start; j < end; j++) {
153
+ const value = channelData[j]
154
+ sumSquares += value * value
155
+ if (j > start && value * prevValue < 0) {
156
+ zeroCrossings++
157
+ }
158
+ prevValue = value
159
+
160
+ // We need to keep absolute value otherwise we cannot visualize properly
161
+ const absValue = Math.abs(value)
162
+ localMinAmplitude = Math.min(localMinAmplitude, absValue)
163
+ localMaxAmplitude = Math.max(localMaxAmplitude, absValue)
164
+
165
+ if (value !== 0) {
166
+ hasNonZeroValue = true
167
+ }
168
+ }
169
+
170
+ // Post-processing checks
171
+ if (!hasNonZeroValue) {
172
+ // All values are zero
173
+ localMinAmplitude = 0
174
+ localMaxAmplitude = 0
175
+ }
176
+
177
+ const rms = Math.sqrt(sumSquares / (end - start))
178
+ minAmplitude = Math.min(minAmplitude, localMinAmplitude)
179
+ maxAmplitude = Math.max(maxAmplitude, localMaxAmplitude)
180
+
181
+ const energy = sumSquares
182
+ const zcr = zeroCrossings / (end - start)
183
+
184
+ const silent = rms < SILENCE_THRESHOLD
185
+ const dB = 20 * Math.log10(rms)
186
+
187
+ if (silent) {
188
+ if (silenceStart === null) {
189
+ silenceStart = start
190
+ } else if (start - silenceStart > MIN_SILENCE_DURATION) {
191
+ // Silence detected for longer than the threshold, set amplitude to 0
192
+ localMaxAmplitude = 0
193
+ localMinAmplitude = 0
194
+ isSpeech = false
195
+ }
196
+ } else {
197
+ silenceStart = null
198
+ if (
199
+ !isSpeech &&
200
+ start - lastSpeechEnd < SPEECH_INERTIA_DURATION
201
+ ) {
202
+ isSpeech = true
203
+ }
204
+ lastSpeechEnd = end
205
+ }
206
+
207
+ const activeSpeech =
208
+ (rms > RMS_THRESHOLD && zcr > ZCR_THRESHOLD) ||
209
+ (isSpeech && start - lastSpeechEnd < SPEECH_INERTIA_DURATION)
210
+
211
+ if (activeSpeech) {
212
+ isSpeech = true
213
+ lastSpeechEnd = end
214
+ } else {
215
+ isSpeech = false
216
+ }
217
+
218
+ const bytesPerSample = bitDepth / 8
219
+ const startPosition = start * bytesPerSample * numberOfChannels // Calculate start position in bytes
220
+ const endPosition = end * bytesPerSample * numberOfChannels // Calculate end position in bytes
221
+
222
+ // Compute features
223
+ const segmentData = channelData.slice(start, end)
224
+ const mfcc = features.mfcc
225
+ ? extractMFCC(segmentData, sampleRate)
226
+ : []
227
+ const spectralCentroid = features.spectralCentroid
228
+ ? extractSpectralCentroid(segmentData, sampleRate)
229
+ : 0
230
+ const spectralFlatness = features.spectralFlatness
231
+ ? extractSpectralFlatness(segmentData)
232
+ : 0
233
+ const spectralRollOff = features.spectralRollOff
234
+ ? extractSpectralRollOff(segmentData, sampleRate)
235
+ : 0
236
+ const spectralBandwidth = features.spectralBandwidth
237
+ ? extractSpectralBandwidth(segmentData, sampleRate)
238
+ : 0
239
+ const chromagram = features.chromagram
240
+ ? extractChromagram(segmentData, sampleRate)
241
+ : []
242
+ const hnr = features.hnr ? extractHNR(segmentData) : 0
243
+
244
+ const peakAmp = Math.max(Math.abs(localMaxAmplitude), Math.abs(localMinAmplitude))
245
+ const newData = {
246
+ id: uniqueIdCounter++, // Assign unique ID and increment the counter
247
+ amplitude: algorithm === 'peak' ? peakAmp : rms,
248
+ activeSpeech,
249
+ dB,
250
+ silent,
251
+ features: {
252
+ energy,
253
+ rms,
254
+ minAmplitude: localMinAmplitude,
255
+ maxAmplitude: localMaxAmplitude,
256
+ zcr,
257
+ mfcc: [], // Placeholder for MFCC features
258
+ spectralCentroid, // Computed spectral centroid
259
+ spectralFlatness, // Computed spectral flatness
260
+ spectralRollOff, // Computed spectral roll-off
261
+ spectralBandwidth, // Computed spectral bandwidth
262
+ chromagram, // Computed chromagram
263
+ hnr, // Computed HNR
264
+ },
265
+ startTime: start / sampleRate,
266
+ endTime: end / sampleRate,
267
+ startPosition,
268
+ endPosition,
269
+ samples: end - start,
270
+ speaker: 0, // Assuming speaker detection is to be handled later
271
+ }
272
+
273
+ dataPoints.push(newData)
274
+ }
275
+
276
+ return {
277
+ pointsPerSecond,
278
+ amplitudeAlgorithm: algorithm,
279
+ durationMs: fullAudioDurationMs,
280
+ bitDepth,
281
+ samples: totalSamples,
282
+ numberOfChannels,
283
+ sampleRate,
284
+ dataPoints,
285
+ amplitudeRange: {
286
+ min: minAmplitude,
287
+ max: maxAmplitude,
288
+ },
289
+ speakerChanges: [], // Placeholder for future speaker detection logic
290
+ }
291
+ }
292
+
293
+ try {
294
+ const result = extractWaveform(
295
+ channelData,
296
+ sampleRate,
297
+ pointsPerSecond,
298
+ algorithm
299
+ )
300
+ self.postMessage({
301
+ command: 'features',
302
+ result,
303
+ })
304
+ } catch (error) {
305
+ console.error('[AudioFeaturesExtractor] Error in processing', error)
306
+ self.postMessage({ error: error.message })
307
+ } finally {
308
+ // Do not close the worker so it can be re-used for subsequent messages
309
+ // self.close();
310
+ }
311
+ }
312
+ `