@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.
- package/.eslintrc.js +2 -0
- package/.size-limit.json +6 -0
- package/.yarn/install-state.gz +0 -0
- package/android/.gradle/8.1.1/checksums/checksums.lock +0 -0
- package/android/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.1.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.1.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.1.1/gc.properties +0 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/results.bin +1 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioAnalysisData$AmplitudeRange.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioAnalysisData$SpeakerChange.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioAnalysisData.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioDataEncoder.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioFileHandler.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioFormatUtils.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor$AudioData.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor$Companion.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor$extractMFCC$powerSpectrum$2.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/AudioRecorderManager.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/BuildConfig.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/Constants.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/DataPoint.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/EventSender.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$1.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$10.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$11.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$12.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$13.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$14.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$15.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$16.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$17.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$18.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$2.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$3.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$4.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$5.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$6.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$7.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$8.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$9.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$1.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$2.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$3.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$4.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$1.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$2.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/FFT.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/Features.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/PermissionUtils.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/debug_dex/net/siteed/audiostream/RecordingConfig.dex +0 -0
- package/android/build/.transforms/10769ccaccd8850af4ffc5504c4368cb/transformed/debug/desugar_graph.bin +0 -0
- package/android/build/.transforms/7bc0cb35da9eb644120553a3af66f984/results.bin +1 -0
- package/android/build/.transforms/7bc0cb35da9eb644120553a3af66f984/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/949f6bd23bdf38f67d1eb7de8f618950/results.bin +1 -0
- package/android/build/.transforms/949f6bd23bdf38f67d1eb7de8f618950/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/java_res/debug/out/META-INF/siteed-expo-audio-stream_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/classes/net/siteed/audiostream/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +14 -0
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +10 -0
- package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/siteed-expo-audio-stream_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioAnalysisData$AmplitudeRange.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioAnalysisData$SpeakerChange.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioAnalysisData.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioDataEncoder.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioFileHandler.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioFormatUtils.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioProcessor$AudioData.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioProcessor$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioProcessor$extractMFCC$powerSpectrum$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioProcessor.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/AudioRecorderManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/Constants.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/DataPoint.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/EventSender.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$10.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$11.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$12.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$13.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$14.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$15.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$16.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$17.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$18.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$5.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$6.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$7.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$8.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$9.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/ExpoAudioStreamModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/FFT.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/Features.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/PermissionUtils.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/net/siteed/audiostream/RecordingConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +1 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.s +1 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.s +1 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +24 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/siteed-expo-audio-stream_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioAnalysisData$AmplitudeRange.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioAnalysisData$SpeakerChange.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioAnalysisData.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioDataEncoder.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioFileHandler.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioFormatUtils.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioProcessor$AudioData.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioProcessor$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioProcessor$extractMFCC$powerSpectrum$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioProcessor.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/AudioRecorderManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/Constants.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/DataPoint.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/EventSender.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$10.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$11.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$12.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$13.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$14.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$15.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$16.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$17.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$18.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$5.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$6.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$7.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$8.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunction$9.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$AsyncFunctionWithPromise$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$14$$inlined$FunctionWithoutArgs$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/ExpoAudioStreamModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/FFT.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/Features.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/PermissionUtils.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/net/siteed/audiostream/RecordingConfig.class +0 -0
- package/app.plugin.js +1 -0
- package/expo-module.config.json +9 -0
- package/package.json +1 -21
- package/plugin/build/index.d.ts +5 -0
- package/plugin/build/index.js +28 -0
- package/plugin/src/index.ts +53 -0
- package/plugin/tsconfig.json +9 -0
- package/publish.sh +8 -0
- package/src/AudioAnalysis/AudioAnalysis.types.ts +84 -0
- package/src/AudioAnalysis/extractAudioAnalysis.ts +147 -0
- package/src/AudioAnalysis/extractWaveform.ts +25 -0
- package/src/AudioRecorder.provider.tsx +53 -0
- package/src/ExpoAudioStream.native.ts +6 -0
- package/src/ExpoAudioStream.types.ts +93 -0
- package/src/ExpoAudioStream.web.ts +255 -0
- package/src/ExpoAudioStreamModule.ts +31 -0
- package/src/WebRecorder.web.ts +433 -0
- package/src/constants.ts +18 -0
- package/src/events.ts +39 -0
- package/src/index.ts +24 -0
- package/src/logger.ts +22 -0
- package/src/useAudioRecorder.tsx +420 -0
- package/src/utils/BlobFix.ts +550 -0
- package/src/utils/concatenateBuffers.ts +24 -0
- package/src/utils/convertPCMToFloat32.ts +75 -0
- package/src/utils/encodingToBitDepth.ts +18 -0
- package/src/utils/getWavFileInfo.ts +132 -0
- package/src/utils/writeWavHeader.ts +61 -0
- package/src/workers/InlineFeaturesExtractor.web.tsx +312 -0
- package/src/workers/inlineAudioWebWorker.web.tsx +250 -0
- 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,61 @@
|
|
|
1
|
+
// packages/expo-audio-stream/src/utils/writeWavHeader.ts
|
|
2
|
+
interface WavHeaderOptions {
|
|
3
|
+
buffer: ArrayBuffer
|
|
4
|
+
sampleRate: number
|
|
5
|
+
numChannels: number
|
|
6
|
+
bitDepth: number
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const writeWavHeader = ({
|
|
10
|
+
buffer,
|
|
11
|
+
sampleRate,
|
|
12
|
+
numChannels,
|
|
13
|
+
bitDepth,
|
|
14
|
+
}: WavHeaderOptions): ArrayBuffer => {
|
|
15
|
+
const bytesPerSample = bitDepth / 8
|
|
16
|
+
const numSamples = buffer.byteLength / (numChannels * bytesPerSample)
|
|
17
|
+
const view = new DataView(buffer)
|
|
18
|
+
const blockAlign = numChannels * bytesPerSample
|
|
19
|
+
const byteRate = sampleRate * blockAlign
|
|
20
|
+
|
|
21
|
+
// Function to write a string to the DataView
|
|
22
|
+
const writeString = (view: DataView, offset: number, string: string) => {
|
|
23
|
+
for (let i = 0; i < string.length; i++) {
|
|
24
|
+
view.setUint8(offset + i, string.charCodeAt(i))
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Check if the buffer already has a WAV header by looking for "RIFF" at the start
|
|
29
|
+
const existingHeader = view.getUint32(0, false) === 0x52494646 // "RIFF" in ASCII
|
|
30
|
+
|
|
31
|
+
if (!existingHeader) {
|
|
32
|
+
// Ensure the buffer is large enough for the WAV header
|
|
33
|
+
if (buffer.byteLength < 44) {
|
|
34
|
+
throw new Error('Buffer is too small to contain a valid WAV header')
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Write the WAV header
|
|
38
|
+
writeString(view, 0, 'RIFF') // ChunkID
|
|
39
|
+
view.setUint32(4, 36 + numSamples * blockAlign, true) // ChunkSize
|
|
40
|
+
writeString(view, 8, 'WAVE') // Format
|
|
41
|
+
writeString(view, 12, 'fmt ') // Subchunk1ID
|
|
42
|
+
view.setUint32(16, 16, true) // Subchunk1Size (16 for PCM)
|
|
43
|
+
view.setUint16(20, bitDepth === 32 ? 3 : 1, true) // AudioFormat (3 for float, 1 for PCM)
|
|
44
|
+
view.setUint16(22, numChannels, true) // NumChannels
|
|
45
|
+
view.setUint32(24, sampleRate, true) // SampleRate
|
|
46
|
+
view.setUint32(28, byteRate, true) // ByteRate
|
|
47
|
+
view.setUint16(32, blockAlign, true) // BlockAlign
|
|
48
|
+
view.setUint16(34, bitDepth, true) // BitsPerSample
|
|
49
|
+
writeString(view, 36, 'data') // Subchunk2ID
|
|
50
|
+
view.setUint32(40, numSamples * blockAlign, true) // Subchunk2Size
|
|
51
|
+
} else {
|
|
52
|
+
// Update the existing WAV header if necessary
|
|
53
|
+
view.setUint32(4, 36 + numSamples * blockAlign, true) // Update ChunkSize
|
|
54
|
+
view.setUint32(24, sampleRate, true) // Update SampleRate
|
|
55
|
+
view.setUint32(28, byteRate, true) // Update ByteRate
|
|
56
|
+
view.setUint16(32, blockAlign, true) // Update BlockAlign
|
|
57
|
+
view.setUint32(40, numSamples * blockAlign, true) // Update Subchunk2Size
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return buffer
|
|
61
|
+
}
|
|
@@ -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
|
+
`
|