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