@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,420 @@
|
|
|
1
|
+
// src/useAudioRecorder.ts
|
|
2
|
+
import { Platform, Subscription } from 'expo-modules-core'
|
|
3
|
+
import { useCallback, useEffect, useReducer, useRef } from 'react'
|
|
4
|
+
|
|
5
|
+
import { AudioAnalysis } from './AudioAnalysis/AudioAnalysis.types'
|
|
6
|
+
import {
|
|
7
|
+
AudioDataEvent,
|
|
8
|
+
AudioRecording,
|
|
9
|
+
AudioStreamStatus,
|
|
10
|
+
RecordingConfig,
|
|
11
|
+
StartRecordingResult,
|
|
12
|
+
} from './ExpoAudioStream.types'
|
|
13
|
+
import ExpoAudioStreamModule from './ExpoAudioStreamModule'
|
|
14
|
+
import {
|
|
15
|
+
addAudioAnalysisListener,
|
|
16
|
+
addAudioEventListener,
|
|
17
|
+
AudioEventPayload,
|
|
18
|
+
} from './events'
|
|
19
|
+
import { getLogger } from './logger'
|
|
20
|
+
|
|
21
|
+
const TAG = 'useAudioRecorder'
|
|
22
|
+
const logger = getLogger(TAG)
|
|
23
|
+
export interface UseAudioRecorderProps {
|
|
24
|
+
debug?: boolean
|
|
25
|
+
audioWorkletUrl?: string
|
|
26
|
+
featuresExtratorUrl?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface UseAudioRecorderState {
|
|
30
|
+
startRecording: (_: RecordingConfig) => Promise<StartRecordingResult>
|
|
31
|
+
stopRecording: () => Promise<AudioRecording>
|
|
32
|
+
pauseRecording: () => void
|
|
33
|
+
resumeRecording: () => void
|
|
34
|
+
isRecording: boolean
|
|
35
|
+
isPaused: boolean
|
|
36
|
+
durationMs: number // Duration of the recording
|
|
37
|
+
size: number // Size in bytes of the recorded audio
|
|
38
|
+
analysisData?: AudioAnalysis
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface RecorderReducerState {
|
|
42
|
+
isRecording: boolean
|
|
43
|
+
isPaused: boolean
|
|
44
|
+
durationMs: number
|
|
45
|
+
size: number
|
|
46
|
+
analysisData?: AudioAnalysis
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type RecorderAction =
|
|
50
|
+
| { type: 'START' | 'STOP' | 'PAUSE' | 'RESUME' }
|
|
51
|
+
| { type: 'UPDATE_STATUS'; payload: { durationMs: number; size: number } }
|
|
52
|
+
| { type: 'UPDATE_ANALYSIS'; payload: AudioAnalysis }
|
|
53
|
+
|
|
54
|
+
const defaultAnalysis: AudioAnalysis = {
|
|
55
|
+
pointsPerSecond: 10,
|
|
56
|
+
bitDepth: 32,
|
|
57
|
+
numberOfChannels: 1,
|
|
58
|
+
durationMs: 0,
|
|
59
|
+
sampleRate: 44100,
|
|
60
|
+
samples: 0,
|
|
61
|
+
dataPoints: [],
|
|
62
|
+
amplitudeAlgorithm: 'rms',
|
|
63
|
+
speakerChanges: [],
|
|
64
|
+
amplitudeRange: {
|
|
65
|
+
min: Number.POSITIVE_INFINITY,
|
|
66
|
+
max: Number.NEGATIVE_INFINITY,
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function audioRecorderReducer(
|
|
71
|
+
state: RecorderReducerState,
|
|
72
|
+
action: RecorderAction
|
|
73
|
+
): RecorderReducerState {
|
|
74
|
+
switch (action.type) {
|
|
75
|
+
case 'START':
|
|
76
|
+
return {
|
|
77
|
+
...state,
|
|
78
|
+
isRecording: true,
|
|
79
|
+
isPaused: false,
|
|
80
|
+
durationMs: 0,
|
|
81
|
+
size: 0,
|
|
82
|
+
analysisData: defaultAnalysis, // Reset analysis data
|
|
83
|
+
}
|
|
84
|
+
case 'STOP':
|
|
85
|
+
return { ...state, isRecording: false, isPaused: false }
|
|
86
|
+
case 'PAUSE':
|
|
87
|
+
return { ...state, isPaused: true, isRecording: false }
|
|
88
|
+
case 'RESUME':
|
|
89
|
+
return { ...state, isPaused: false, isRecording: true }
|
|
90
|
+
case 'UPDATE_STATUS':
|
|
91
|
+
return {
|
|
92
|
+
...state,
|
|
93
|
+
durationMs: action.payload.durationMs,
|
|
94
|
+
size: action.payload.size,
|
|
95
|
+
}
|
|
96
|
+
case 'UPDATE_ANALYSIS':
|
|
97
|
+
return {
|
|
98
|
+
...state,
|
|
99
|
+
analysisData: action.payload,
|
|
100
|
+
}
|
|
101
|
+
default:
|
|
102
|
+
return state
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface HandleAudioAnalysisProps {
|
|
107
|
+
analysis: AudioAnalysis
|
|
108
|
+
visualizationDuration: number
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function useAudioRecorder({
|
|
112
|
+
debug = false,
|
|
113
|
+
audioWorkletUrl,
|
|
114
|
+
featuresExtratorUrl,
|
|
115
|
+
}: UseAudioRecorderProps = {}): UseAudioRecorderState {
|
|
116
|
+
const [state, dispatch] = useReducer(audioRecorderReducer, {
|
|
117
|
+
isRecording: false,
|
|
118
|
+
isPaused: false,
|
|
119
|
+
durationMs: 0,
|
|
120
|
+
size: 0,
|
|
121
|
+
analysisData: undefined,
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
const analysisListenerRef = useRef<Subscription | null>(null)
|
|
125
|
+
const analysisRef = useRef<AudioAnalysis>({ ...defaultAnalysis })
|
|
126
|
+
|
|
127
|
+
// Instantiate the module for web with URLs
|
|
128
|
+
const ExpoAudioStream =
|
|
129
|
+
Platform.OS === 'web'
|
|
130
|
+
? ExpoAudioStreamModule({ audioWorkletUrl, featuresExtratorUrl })
|
|
131
|
+
: ExpoAudioStreamModule
|
|
132
|
+
|
|
133
|
+
const onAudioStreamRef = useRef<
|
|
134
|
+
((_: AudioDataEvent) => Promise<void>) | null
|
|
135
|
+
>(null)
|
|
136
|
+
|
|
137
|
+
const handleAudioAnalysis = useCallback(
|
|
138
|
+
async ({
|
|
139
|
+
analysis,
|
|
140
|
+
visualizationDuration,
|
|
141
|
+
}: HandleAudioAnalysisProps) => {
|
|
142
|
+
const savedAnalysisData = analysisRef.current || {
|
|
143
|
+
...defaultAnalysis,
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const maxDuration = visualizationDuration
|
|
147
|
+
|
|
148
|
+
logger.debug(
|
|
149
|
+
`[handleAudioAnalysis] Received audio analysis: maxDuration=${maxDuration} analysis.dataPoints=${analysis.dataPoints.length} analysisData.dataPoints=${savedAnalysisData.dataPoints.length}`,
|
|
150
|
+
analysis
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
// Combine data points
|
|
154
|
+
const combinedDataPoints = [
|
|
155
|
+
...savedAnalysisData.dataPoints,
|
|
156
|
+
...analysis.dataPoints,
|
|
157
|
+
]
|
|
158
|
+
|
|
159
|
+
// Calculate the new duration
|
|
160
|
+
const pointsPerSecond =
|
|
161
|
+
analysis.pointsPerSecond || savedAnalysisData.pointsPerSecond
|
|
162
|
+
const maxDataPoints =
|
|
163
|
+
(pointsPerSecond * visualizationDuration) / 1000
|
|
164
|
+
|
|
165
|
+
logger.debug(
|
|
166
|
+
`[handleAudioAnalysis] Combined data points before trimming: pointsPerSecond=${pointsPerSecond} visualizationDuration=${visualizationDuration} combinedDataPointsLength=${combinedDataPoints.length} vs maxDataPoints=${maxDataPoints}`
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
// Trim data points to keep within the maximum number of data points
|
|
170
|
+
if (combinedDataPoints.length > maxDataPoints) {
|
|
171
|
+
combinedDataPoints.splice(
|
|
172
|
+
0,
|
|
173
|
+
combinedDataPoints.length - maxDataPoints
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
savedAnalysisData.dataPoints = combinedDataPoints
|
|
178
|
+
savedAnalysisData.bitDepth =
|
|
179
|
+
analysis.bitDepth || savedAnalysisData.bitDepth
|
|
180
|
+
savedAnalysisData.durationMs =
|
|
181
|
+
combinedDataPoints.length * (1000 / pointsPerSecond)
|
|
182
|
+
|
|
183
|
+
// Update amplitude range
|
|
184
|
+
const newMin = Math.min(
|
|
185
|
+
savedAnalysisData.amplitudeRange.min,
|
|
186
|
+
analysis.amplitudeRange.min
|
|
187
|
+
)
|
|
188
|
+
const newMax = Math.max(
|
|
189
|
+
savedAnalysisData.amplitudeRange.max,
|
|
190
|
+
analysis.amplitudeRange.max
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
savedAnalysisData.amplitudeRange = {
|
|
194
|
+
min: newMin,
|
|
195
|
+
max: newMax,
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
logger.debug(
|
|
199
|
+
`[handleAudioAnalysis] Updated analysis data: durationMs=${savedAnalysisData.durationMs}`,
|
|
200
|
+
savedAnalysisData
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
// Update the ref
|
|
204
|
+
analysisRef.current = savedAnalysisData
|
|
205
|
+
|
|
206
|
+
// Dispatch the updated analysis data to state to trigger re-render
|
|
207
|
+
// need to use spread operator otherwise it doesnt trigger update.
|
|
208
|
+
dispatch({
|
|
209
|
+
type: 'UPDATE_ANALYSIS',
|
|
210
|
+
payload: { ...savedAnalysisData },
|
|
211
|
+
})
|
|
212
|
+
},
|
|
213
|
+
[dispatch]
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
const handleAudioEvent = useCallback(
|
|
217
|
+
async (eventData: AudioEventPayload) => {
|
|
218
|
+
const {
|
|
219
|
+
fileUri,
|
|
220
|
+
deltaSize,
|
|
221
|
+
totalSize,
|
|
222
|
+
lastEmittedSize,
|
|
223
|
+
position,
|
|
224
|
+
streamUuid,
|
|
225
|
+
encoded,
|
|
226
|
+
mimeType,
|
|
227
|
+
buffer,
|
|
228
|
+
} = eventData
|
|
229
|
+
logger.debug(`[handleAudioEvent] Received audio event:`, {
|
|
230
|
+
fileUri,
|
|
231
|
+
deltaSize,
|
|
232
|
+
totalSize,
|
|
233
|
+
position,
|
|
234
|
+
mimeType,
|
|
235
|
+
lastEmittedSize,
|
|
236
|
+
streamUuid,
|
|
237
|
+
encodedLength: encoded?.length,
|
|
238
|
+
})
|
|
239
|
+
if (deltaSize === 0) {
|
|
240
|
+
// Ignore packet with no data
|
|
241
|
+
return
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
// Coming from native ( ios / android ) otherwise buffer is set
|
|
245
|
+
if (Platform.OS !== 'web') {
|
|
246
|
+
// Read the audio file as a base64 string for comparison
|
|
247
|
+
if (!encoded) {
|
|
248
|
+
console.error(`${TAG} Encoded audio data is missing`)
|
|
249
|
+
throw new Error('Encoded audio data is missing')
|
|
250
|
+
}
|
|
251
|
+
onAudioStreamRef.current?.({
|
|
252
|
+
data: encoded,
|
|
253
|
+
position,
|
|
254
|
+
fileUri,
|
|
255
|
+
eventDataSize: deltaSize,
|
|
256
|
+
totalSize,
|
|
257
|
+
})
|
|
258
|
+
} else if (buffer) {
|
|
259
|
+
// Coming from web
|
|
260
|
+
const webEvent: AudioDataEvent = {
|
|
261
|
+
data: buffer,
|
|
262
|
+
position,
|
|
263
|
+
fileUri,
|
|
264
|
+
eventDataSize: deltaSize,
|
|
265
|
+
totalSize,
|
|
266
|
+
}
|
|
267
|
+
onAudioStreamRef.current?.(webEvent)
|
|
268
|
+
logger.debug(
|
|
269
|
+
`[handleAudioEvent] Audio data sent to onAudioStream`,
|
|
270
|
+
webEvent
|
|
271
|
+
)
|
|
272
|
+
}
|
|
273
|
+
} catch (error) {
|
|
274
|
+
console.error(`${TAG} Error processing audio event:`, error)
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
[]
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
const checkStatus = useCallback(async () => {
|
|
281
|
+
try {
|
|
282
|
+
if (!state.isRecording) {
|
|
283
|
+
logger.debug(`Not recording, exiting status check.`)
|
|
284
|
+
return
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const status: AudioStreamStatus = ExpoAudioStream.status()
|
|
288
|
+
if (debug) {
|
|
289
|
+
logger.debug(`Status:`, status)
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
dispatch({
|
|
293
|
+
type: 'UPDATE_STATUS',
|
|
294
|
+
payload: { durationMs: status.durationMs, size: status.size },
|
|
295
|
+
})
|
|
296
|
+
} catch (error) {
|
|
297
|
+
console.error(`${TAG} Error getting status:`, error)
|
|
298
|
+
}
|
|
299
|
+
}, [state.isRecording])
|
|
300
|
+
|
|
301
|
+
const startRecording = useCallback(
|
|
302
|
+
async (recordingOptions: RecordingConfig) => {
|
|
303
|
+
logger.debug(`start recoding`, recordingOptions)
|
|
304
|
+
|
|
305
|
+
analysisRef.current = { ...defaultAnalysis } // Reset analysis data
|
|
306
|
+
|
|
307
|
+
const { onAudioStream, ...options } = recordingOptions
|
|
308
|
+
const { enableProcessing } = options
|
|
309
|
+
|
|
310
|
+
const maxRecentDataDuration = 10000 // TODO compute maxRecentDataDuration based on screen dimensions
|
|
311
|
+
if (typeof onAudioStream === 'function') {
|
|
312
|
+
onAudioStreamRef.current = onAudioStream
|
|
313
|
+
} else {
|
|
314
|
+
console.warn(
|
|
315
|
+
`${TAG} onAudioStream is not a function`,
|
|
316
|
+
onAudioStream
|
|
317
|
+
)
|
|
318
|
+
onAudioStreamRef.current = null
|
|
319
|
+
}
|
|
320
|
+
const startResult: StartRecordingResult =
|
|
321
|
+
await ExpoAudioStream.startRecording(options)
|
|
322
|
+
dispatch({ type: 'START' })
|
|
323
|
+
|
|
324
|
+
if (enableProcessing) {
|
|
325
|
+
logger.debug(`Enabling audio analysis listener`)
|
|
326
|
+
const listener = addAudioAnalysisListener(
|
|
327
|
+
async (analysisData) => {
|
|
328
|
+
try {
|
|
329
|
+
await handleAudioAnalysis({
|
|
330
|
+
analysis: analysisData,
|
|
331
|
+
visualizationDuration: maxRecentDataDuration,
|
|
332
|
+
})
|
|
333
|
+
} catch (error) {
|
|
334
|
+
console.warn(
|
|
335
|
+
`${TAG} Error processing audio analysis:`,
|
|
336
|
+
error
|
|
337
|
+
)
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
analysisListenerRef.current = listener
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
return startResult
|
|
346
|
+
},
|
|
347
|
+
[handleAudioAnalysis, dispatch]
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
const stopRecording = useCallback(async () => {
|
|
351
|
+
logger.debug(`stoping recording`)
|
|
352
|
+
|
|
353
|
+
const stopResult: AudioRecording = await ExpoAudioStream.stopRecording()
|
|
354
|
+
stopResult.analysisData = analysisRef.current
|
|
355
|
+
|
|
356
|
+
if (analysisListenerRef.current) {
|
|
357
|
+
analysisListenerRef.current.remove()
|
|
358
|
+
analysisListenerRef.current = null
|
|
359
|
+
}
|
|
360
|
+
onAudioStreamRef.current = null
|
|
361
|
+
logger.debug(`recording stopped`, stopResult)
|
|
362
|
+
dispatch({ type: 'STOP' })
|
|
363
|
+
return stopResult
|
|
364
|
+
}, [dispatch])
|
|
365
|
+
|
|
366
|
+
const pauseRecording = useCallback(async () => {
|
|
367
|
+
logger.debug(`pause recording`)
|
|
368
|
+
const pauseResult = await ExpoAudioStream.pauseRecording()
|
|
369
|
+
dispatch({ type: 'PAUSE' })
|
|
370
|
+
return pauseResult
|
|
371
|
+
}, [dispatch])
|
|
372
|
+
|
|
373
|
+
const resumeRecording = useCallback(async () => {
|
|
374
|
+
logger.debug(`resume recording`)
|
|
375
|
+
const resumeResult = await ExpoAudioStream.resumeRecording()
|
|
376
|
+
dispatch({ type: 'RESUME' })
|
|
377
|
+
return resumeResult
|
|
378
|
+
}, [dispatch])
|
|
379
|
+
|
|
380
|
+
useEffect(() => {
|
|
381
|
+
let interval: ReturnType<typeof setTimeout>
|
|
382
|
+
if (state.isRecording) {
|
|
383
|
+
interval = setInterval(checkStatus, 1000)
|
|
384
|
+
}
|
|
385
|
+
return () => {
|
|
386
|
+
if (interval) {
|
|
387
|
+
clearInterval(interval)
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}, [checkStatus, state.isRecording])
|
|
391
|
+
|
|
392
|
+
useEffect(() => {
|
|
393
|
+
logger.debug(`Registering audio event listener`)
|
|
394
|
+
const subscribeAudio = addAudioEventListener(handleAudioEvent)
|
|
395
|
+
|
|
396
|
+
logger.debug(
|
|
397
|
+
`Subscribed to audio event listener and analysis listener`,
|
|
398
|
+
{
|
|
399
|
+
subscribeAudio,
|
|
400
|
+
}
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
return () => {
|
|
404
|
+
logger.debug(`Removing audio event listener`)
|
|
405
|
+
subscribeAudio.remove()
|
|
406
|
+
}
|
|
407
|
+
}, [handleAudioEvent, handleAudioAnalysis])
|
|
408
|
+
|
|
409
|
+
return {
|
|
410
|
+
startRecording,
|
|
411
|
+
stopRecording,
|
|
412
|
+
pauseRecording,
|
|
413
|
+
resumeRecording,
|
|
414
|
+
isPaused: state.isPaused,
|
|
415
|
+
isRecording: state.isRecording,
|
|
416
|
+
durationMs: state.durationMs,
|
|
417
|
+
size: state.size,
|
|
418
|
+
analysisData: state.analysisData,
|
|
419
|
+
}
|
|
420
|
+
}
|