@siteed/expo-audio-studio 2.18.5 → 3.0.0
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/README.md +13 -297
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +6 -135
- package/CHANGELOG.md +0 -493
- package/LICENSE +0 -21
- package/android/build.gradle +0 -129
- package/android/src/androidTest/assets/chorus.wav +0 -0
- package/android/src/androidTest/assets/jfk.wav +0 -0
- package/android/src/androidTest/assets/osr_us_000_0010_8k.wav +0 -0
- package/android/src/androidTest/assets/recorder_hello_world.wav +0 -0
- package/android/src/androidTest/java/net/siteed/audiostream/AudioProcessorInstrumentedTest.kt +0 -197
- package/android/src/androidTest/java/net/siteed/audiostream/AudioRecorderInstrumentedTest.kt +0 -541
- package/android/src/androidTest/java/net/siteed/audiostream/AudioRecorderPerformanceInstrumentedTest.kt +0 -234
- package/android/src/androidTest/java/net/siteed/audiostream/integration/AudioFocusStrategyIntegrationTest.kt +0 -332
- package/android/src/androidTest/java/net/siteed/audiostream/integration/BufferDurationIntegrationTest.kt +0 -324
- package/android/src/androidTest/java/net/siteed/audiostream/integration/CompressedOnlyOutputTest.kt +0 -253
- package/android/src/androidTest/java/net/siteed/audiostream/integration/DeviceDisconnectionFallbackTest.kt +0 -218
- package/android/src/androidTest/java/net/siteed/audiostream/integration/EventEmissionIntervalTest.kt +0 -120
- package/android/src/androidTest/java/net/siteed/audiostream/integration/M4aFormatTest.kt +0 -345
- package/android/src/androidTest/java/net/siteed/audiostream/integration/OutputControlIntegrationTest.kt +0 -340
- package/android/src/androidTest/java/net/siteed/audiostream/integration/PcmStreamingDurationTest.kt +0 -252
- package/android/src/androidTest/java/net/siteed/audiostream/integration/README.md +0 -95
- package/android/src/androidTest/java/net/siteed/audiostream/integration/run_integration_tests.sh +0 -43
- package/android/src/main/AndroidManifest.xml +0 -30
- package/android/src/main/java/net/siteed/audiostream/AudioAnalysisData.kt +0 -188
- package/android/src/main/java/net/siteed/audiostream/AudioDataEncoder.kt +0 -9
- package/android/src/main/java/net/siteed/audiostream/AudioDeviceManager.kt +0 -1741
- package/android/src/main/java/net/siteed/audiostream/AudioFileHandler.kt +0 -136
- package/android/src/main/java/net/siteed/audiostream/AudioFormatUtils.kt +0 -354
- package/android/src/main/java/net/siteed/audiostream/AudioNotificationsManager.kt +0 -439
- package/android/src/main/java/net/siteed/audiostream/AudioProcessor.kt +0 -2237
- package/android/src/main/java/net/siteed/audiostream/AudioRecorderManager.kt +0 -2141
- package/android/src/main/java/net/siteed/audiostream/AudioRecordingService.kt +0 -167
- package/android/src/main/java/net/siteed/audiostream/AudioTrimmer.kt +0 -1099
- package/android/src/main/java/net/siteed/audiostream/Constants.kt +0 -37
- package/android/src/main/java/net/siteed/audiostream/EventSender.kt +0 -7
- package/android/src/main/java/net/siteed/audiostream/ExpoAudioStreamModule.kt +0 -1113
- package/android/src/main/java/net/siteed/audiostream/FFT.kt +0 -99
- package/android/src/main/java/net/siteed/audiostream/Features.kt +0 -98
- package/android/src/main/java/net/siteed/audiostream/LogUtils.kt +0 -93
- package/android/src/main/java/net/siteed/audiostream/NotificationConfig.kt +0 -72
- package/android/src/main/java/net/siteed/audiostream/PermissionUtils.kt +0 -68
- package/android/src/main/java/net/siteed/audiostream/RecordingActionReceiver.kt +0 -59
- package/android/src/main/java/net/siteed/audiostream/RecordingConfig.kt +0 -257
- package/android/src/main/java/net/siteed/audiostream/WaveformConfig.kt +0 -19
- package/android/src/main/java/net/siteed/audiostream/WaveformRenderer.kt +0 -159
- package/android/src/main/res/drawable/ic_default_action_icon.xml +0 -16
- package/android/src/main/res/drawable/ic_microphone.xml +0 -13
- package/android/src/main/res/drawable/ic_pause.xml +0 -10
- package/android/src/main/res/drawable/ic_play.xml +0 -10
- package/android/src/main/res/drawable/ic_stop.xml +0 -10
- package/android/src/main/res/layout/notification_recording.xml +0 -37
- package/android/src/test/java/net/siteed/audiostream/AudioFileHandlerTest.kt +0 -279
- package/android/src/test/java/net/siteed/audiostream/AudioFocusStrategyTest.kt +0 -249
- package/android/src/test/java/net/siteed/audiostream/AudioFormatTest.kt +0 -151
- package/android/src/test/java/net/siteed/audiostream/AudioFormatUtilsTest.kt +0 -273
- package/android/src/test/java/net/siteed/audiostream/DeviceDisconnectionFallbackUnitTest.kt +0 -140
- package/android/src/test/resources/chorus.wav +0 -0
- package/android/src/test/resources/generate_test_audio.py +0 -94
- package/android/src/test/resources/jfk.wav +0 -0
- package/android/src/test/resources/osr_us_000_0010_8k.wav +0 -0
- package/android/src/test/resources/recorder_hello_world.wav +0 -0
- package/app.plugin.js +0 -3
- package/build/cjs/AudioAnalysis/AudioAnalysis.types.js +0 -4
- package/build/cjs/AudioAnalysis/AudioAnalysis.types.js.map +0 -1
- package/build/cjs/AudioAnalysis/extractAudioAnalysis.js +0 -210
- package/build/cjs/AudioAnalysis/extractAudioAnalysis.js.map +0 -1
- package/build/cjs/AudioAnalysis/extractAudioData.js +0 -21
- package/build/cjs/AudioAnalysis/extractAudioData.js.map +0 -1
- package/build/cjs/AudioAnalysis/extractMelSpectrogram.js +0 -92
- package/build/cjs/AudioAnalysis/extractMelSpectrogram.js.map +0 -1
- package/build/cjs/AudioAnalysis/extractPreview.js +0 -28
- package/build/cjs/AudioAnalysis/extractPreview.js.map +0 -1
- package/build/cjs/AudioAnalysis/extractWaveform.js +0 -18
- package/build/cjs/AudioAnalysis/extractWaveform.js.map +0 -1
- package/build/cjs/AudioDeviceManager.js +0 -689
- package/build/cjs/AudioDeviceManager.js.map +0 -1
- package/build/cjs/AudioRecorder.provider.js +0 -78
- package/build/cjs/AudioRecorder.provider.js.map +0 -1
- package/build/cjs/ExpoAudioStream.native.js +0 -8
- package/build/cjs/ExpoAudioStream.native.js.map +0 -1
- package/build/cjs/ExpoAudioStream.types.js +0 -11
- package/build/cjs/ExpoAudioStream.types.js.map +0 -1
- package/build/cjs/ExpoAudioStream.web.js +0 -708
- package/build/cjs/ExpoAudioStream.web.js.map +0 -1
- package/build/cjs/ExpoAudioStreamModule.js +0 -718
- package/build/cjs/ExpoAudioStreamModule.js.map +0 -1
- package/build/cjs/WebRecorder.web.js +0 -777
- package/build/cjs/WebRecorder.web.js.map +0 -1
- package/build/cjs/constants/platformLimitations.js +0 -99
- package/build/cjs/constants/platformLimitations.js.map +0 -1
- package/build/cjs/constants.js +0 -17
- package/build/cjs/constants.js.map +0 -1
- package/build/cjs/events.js +0 -29
- package/build/cjs/events.js.map +0 -1
- package/build/cjs/hooks/useAudioDevices.js +0 -179
- package/build/cjs/hooks/useAudioDevices.js.map +0 -1
- package/build/cjs/index.js +0 -58
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/trimAudio.js +0 -76
- package/build/cjs/trimAudio.js.map +0 -1
- package/build/cjs/useAudioRecorder.js +0 -518
- package/build/cjs/useAudioRecorder.js.map +0 -1
- package/build/cjs/utils/BlobFix.js +0 -502
- package/build/cjs/utils/BlobFix.js.map +0 -1
- package/build/cjs/utils/audioProcessing.js +0 -136
- package/build/cjs/utils/audioProcessing.js.map +0 -1
- package/build/cjs/utils/cleanNativeOptions.js +0 -22
- package/build/cjs/utils/cleanNativeOptions.js.map +0 -1
- package/build/cjs/utils/concatenateBuffers.js +0 -25
- package/build/cjs/utils/concatenateBuffers.js.map +0 -1
- package/build/cjs/utils/convertPCMToFloat32.js +0 -124
- package/build/cjs/utils/convertPCMToFloat32.js.map +0 -1
- package/build/cjs/utils/crc32.js +0 -52
- package/build/cjs/utils/crc32.js.map +0 -1
- package/build/cjs/utils/encodingToBitDepth.js +0 -17
- package/build/cjs/utils/encodingToBitDepth.js.map +0 -1
- package/build/cjs/utils/getWavFileInfo.js +0 -96
- package/build/cjs/utils/getWavFileInfo.js.map +0 -1
- package/build/cjs/utils/writeWavHeader.js +0 -88
- package/build/cjs/utils/writeWavHeader.js.map +0 -1
- package/build/cjs/workers/InlineFeaturesExtractor.web.js +0 -859
- package/build/cjs/workers/InlineFeaturesExtractor.web.js.map +0 -1
- package/build/cjs/workers/inlineAudioWebWorker.web.js +0 -184
- package/build/cjs/workers/inlineAudioWebWorker.web.js.map +0 -1
- package/build/esm/AudioAnalysis/AudioAnalysis.types.js +0 -3
- package/build/esm/AudioAnalysis/AudioAnalysis.types.js.map +0 -1
- package/build/esm/AudioAnalysis/extractAudioAnalysis.js +0 -202
- package/build/esm/AudioAnalysis/extractAudioAnalysis.js.map +0 -1
- package/build/esm/AudioAnalysis/extractAudioData.js +0 -14
- package/build/esm/AudioAnalysis/extractAudioData.js.map +0 -1
- package/build/esm/AudioAnalysis/extractMelSpectrogram.js +0 -89
- package/build/esm/AudioAnalysis/extractMelSpectrogram.js.map +0 -1
- package/build/esm/AudioAnalysis/extractPreview.js +0 -25
- package/build/esm/AudioAnalysis/extractPreview.js.map +0 -1
- package/build/esm/AudioAnalysis/extractWaveform.js +0 -11
- package/build/esm/AudioAnalysis/extractWaveform.js.map +0 -1
- package/build/esm/AudioDeviceManager.js +0 -682
- package/build/esm/AudioDeviceManager.js.map +0 -1
- package/build/esm/AudioRecorder.provider.js +0 -40
- package/build/esm/AudioRecorder.provider.js.map +0 -1
- package/build/esm/ExpoAudioStream.native.js +0 -6
- package/build/esm/ExpoAudioStream.native.js.map +0 -1
- package/build/esm/ExpoAudioStream.types.js +0 -8
- package/build/esm/ExpoAudioStream.types.js.map +0 -1
- package/build/esm/ExpoAudioStream.web.js +0 -704
- package/build/esm/ExpoAudioStream.web.js.map +0 -1
- package/build/esm/ExpoAudioStreamModule.js +0 -713
- package/build/esm/ExpoAudioStreamModule.js.map +0 -1
- package/build/esm/WebRecorder.web.js +0 -773
- package/build/esm/WebRecorder.web.js.map +0 -1
- package/build/esm/constants/platformLimitations.js +0 -90
- package/build/esm/constants/platformLimitations.js.map +0 -1
- package/build/esm/constants.js +0 -14
- package/build/esm/constants.js.map +0 -1
- package/build/esm/events.js +0 -21
- package/build/esm/events.js.map +0 -1
- package/build/esm/hooks/useAudioDevices.js +0 -176
- package/build/esm/hooks/useAudioDevices.js.map +0 -1
- package/build/esm/index.js +0 -20
- package/build/esm/index.js.map +0 -1
- package/build/esm/trimAudio.js +0 -69
- package/build/esm/trimAudio.js.map +0 -1
- package/build/esm/useAudioRecorder.js +0 -512
- package/build/esm/useAudioRecorder.js.map +0 -1
- package/build/esm/utils/BlobFix.js +0 -498
- package/build/esm/utils/BlobFix.js.map +0 -1
- package/build/esm/utils/audioProcessing.js +0 -133
- package/build/esm/utils/audioProcessing.js.map +0 -1
- package/build/esm/utils/cleanNativeOptions.js +0 -19
- package/build/esm/utils/cleanNativeOptions.js.map +0 -1
- package/build/esm/utils/concatenateBuffers.js +0 -21
- package/build/esm/utils/concatenateBuffers.js.map +0 -1
- package/build/esm/utils/convertPCMToFloat32.js +0 -120
- package/build/esm/utils/convertPCMToFloat32.js.map +0 -1
- package/build/esm/utils/crc32.js +0 -50
- package/build/esm/utils/crc32.js.map +0 -1
- package/build/esm/utils/encodingToBitDepth.js +0 -13
- package/build/esm/utils/encodingToBitDepth.js.map +0 -1
- package/build/esm/utils/getWavFileInfo.js +0 -92
- package/build/esm/utils/getWavFileInfo.js.map +0 -1
- package/build/esm/utils/writeWavHeader.js +0 -84
- package/build/esm/utils/writeWavHeader.js.map +0 -1
- package/build/esm/workers/InlineFeaturesExtractor.web.js +0 -856
- package/build/esm/workers/InlineFeaturesExtractor.web.js.map +0 -1
- package/build/esm/workers/inlineAudioWebWorker.web.js +0 -181
- package/build/esm/workers/inlineAudioWebWorker.web.js.map +0 -1
- package/build/types/AudioAnalysis/AudioAnalysis.types.d.ts +0 -196
- package/build/types/AudioAnalysis/AudioAnalysis.types.d.ts.map +0 -1
- package/build/types/AudioAnalysis/extractAudioAnalysis.d.ts +0 -74
- package/build/types/AudioAnalysis/extractAudioAnalysis.d.ts.map +0 -1
- package/build/types/AudioAnalysis/extractAudioData.d.ts +0 -3
- package/build/types/AudioAnalysis/extractAudioData.d.ts.map +0 -1
- package/build/types/AudioAnalysis/extractMelSpectrogram.d.ts +0 -14
- package/build/types/AudioAnalysis/extractMelSpectrogram.d.ts.map +0 -1
- package/build/types/AudioAnalysis/extractPreview.d.ts +0 -11
- package/build/types/AudioAnalysis/extractPreview.d.ts.map +0 -1
- package/build/types/AudioAnalysis/extractWaveform.d.ts +0 -8
- package/build/types/AudioAnalysis/extractWaveform.d.ts.map +0 -1
- package/build/types/AudioDeviceManager.d.ts +0 -187
- package/build/types/AudioDeviceManager.d.ts.map +0 -1
- package/build/types/AudioRecorder.provider.d.ts +0 -11
- package/build/types/AudioRecorder.provider.d.ts.map +0 -1
- package/build/types/ExpoAudioStream.native.d.ts +0 -3
- package/build/types/ExpoAudioStream.native.d.ts.map +0 -1
- package/build/types/ExpoAudioStream.types.d.ts +0 -738
- package/build/types/ExpoAudioStream.types.d.ts.map +0 -1
- package/build/types/ExpoAudioStream.web.d.ts +0 -96
- package/build/types/ExpoAudioStream.web.d.ts.map +0 -1
- package/build/types/ExpoAudioStreamModule.d.ts +0 -3
- package/build/types/ExpoAudioStreamModule.d.ts.map +0 -1
- package/build/types/WebRecorder.web.d.ts +0 -198
- package/build/types/WebRecorder.web.d.ts.map +0 -1
- package/build/types/constants/platformLimitations.d.ts +0 -40
- package/build/types/constants/platformLimitations.d.ts.map +0 -1
- package/build/types/constants.d.ts +0 -11
- package/build/types/constants.d.ts.map +0 -1
- package/build/types/events.d.ts +0 -26
- package/build/types/events.d.ts.map +0 -1
- package/build/types/hooks/useAudioDevices.d.ts +0 -15
- package/build/types/hooks/useAudioDevices.d.ts.map +0 -1
- package/build/types/index.d.ts +0 -18
- package/build/types/index.d.ts.map +0 -1
- package/build/types/trimAudio.d.ts +0 -25
- package/build/types/trimAudio.d.ts.map +0 -1
- package/build/types/useAudioRecorder.d.ts +0 -22
- package/build/types/useAudioRecorder.d.ts.map +0 -1
- package/build/types/utils/BlobFix.d.ts +0 -9
- package/build/types/utils/BlobFix.d.ts.map +0 -1
- package/build/types/utils/audioProcessing.d.ts +0 -24
- package/build/types/utils/audioProcessing.d.ts.map +0 -1
- package/build/types/utils/cleanNativeOptions.d.ts +0 -15
- package/build/types/utils/cleanNativeOptions.d.ts.map +0 -1
- package/build/types/utils/concatenateBuffers.d.ts +0 -8
- package/build/types/utils/concatenateBuffers.d.ts.map +0 -1
- package/build/types/utils/convertPCMToFloat32.d.ts +0 -13
- package/build/types/utils/convertPCMToFloat32.d.ts.map +0 -1
- package/build/types/utils/crc32.d.ts +0 -7
- package/build/types/utils/crc32.d.ts.map +0 -1
- package/build/types/utils/encodingToBitDepth.d.ts +0 -5
- package/build/types/utils/encodingToBitDepth.d.ts.map +0 -1
- package/build/types/utils/getWavFileInfo.d.ts +0 -26
- package/build/types/utils/getWavFileInfo.d.ts.map +0 -1
- package/build/types/utils/writeWavHeader.d.ts +0 -34
- package/build/types/utils/writeWavHeader.d.ts.map +0 -1
- package/build/types/workers/InlineFeaturesExtractor.web.d.ts +0 -2
- package/build/types/workers/InlineFeaturesExtractor.web.d.ts.map +0 -1
- package/build/types/workers/inlineAudioWebWorker.web.d.ts +0 -2
- package/build/types/workers/inlineAudioWebWorker.web.d.ts.map +0 -1
- package/expo-module.config.json +0 -10
- package/ios/AudioAnalysisData.swift +0 -74
- package/ios/AudioDeviceManager.swift +0 -666
- package/ios/AudioNotificationManager.swift +0 -154
- package/ios/AudioProcessingHelpers.swift +0 -743
- package/ios/AudioProcessor.swift +0 -1151
- package/ios/AudioStreamError.swift +0 -7
- package/ios/AudioStreamManager.swift +0 -2352
- package/ios/AudioStreamManagerDelegate.swift +0 -16
- package/ios/DataPoint.swift +0 -54
- package/ios/DecodingConfig.swift +0 -59
- package/ios/ExpoAudioStream.podspec +0 -33
- package/ios/ExpoAudioStreamModule.swift +0 -1013
- package/ios/ExpoAudioStudioTests/AudioFileHandlerTests.swift +0 -338
- package/ios/ExpoAudioStudioTests/AudioFormatUtilsTests.swift +0 -331
- package/ios/ExpoAudioStudioTests/AudioTestHelpers.swift +0 -130
- package/ios/ExpoAudioStudioTests/CompressedOnlyOutputTests.swift +0 -294
- package/ios/ExpoAudioStudioTests/EventEmissionIntervalTests.swift +0 -105
- package/ios/ExpoAudioStudioTests/Info.plist +0 -22
- package/ios/ExpoAudioStudioTests/README.md +0 -39
- package/ios/ExpoAudioStudioTests/SimpleAudioTest.swift +0 -98
- package/ios/ExpoAudioStudioTests/TestAudioGenerator.swift +0 -75
- package/ios/FFT.swift +0 -62
- package/ios/Features.swift +0 -95
- package/ios/ISSUE_IOS.md +0 -68
- package/ios/Logger.swift +0 -39
- package/ios/NotificationExtension.swift +0 -15
- package/ios/RecordingResult.swift +0 -22
- package/ios/RecordingSettings.swift +0 -308
- package/ios/WaveformExtractor.swift +0 -105
- package/ios/tests/README.md +0 -41
- package/ios/tests/integration/buffer_and_fallback_test.swift +0 -178
- package/ios/tests/integration/buffer_duration_test.swift +0 -185
- package/ios/tests/integration/compressed_only_output_test.swift +0 -271
- package/ios/tests/integration/output_control_test.swift +0 -322
- package/ios/tests/integration/run_integration_tests.sh +0 -37
- package/ios/tests/opus_support_test_macos.swift +0 -154
- package/ios/tests/standalone/audio_processing_test.swift +0 -144
- package/ios/tests/standalone/audio_recording_test.swift +0 -277
- package/ios/tests/standalone/audio_streaming_test.swift +0 -249
- package/ios/tests/standalone/standalone_test.swift +0 -144
- package/plugin/build/index.cjs +0 -194
- package/plugin/build/index.d.cts +0 -22
- package/plugin/build/index.js +0 -194
- package/plugin/src/index.ts +0 -285
- package/plugin/tsconfig.json +0 -10
- package/plugin/tsconfig.tsbuildinfo +0 -1
- package/src/AudioAnalysis/AudioAnalysis.types.ts +0 -224
- package/src/AudioAnalysis/extractAudioAnalysis.ts +0 -344
- package/src/AudioAnalysis/extractAudioData.ts +0 -17
- package/src/AudioAnalysis/extractMelSpectrogram.ts +0 -154
- package/src/AudioAnalysis/extractPreview.ts +0 -34
- package/src/AudioAnalysis/extractWaveform.ts +0 -22
- package/src/AudioDeviceManager.ts +0 -803
- package/src/AudioRecorder.provider.tsx +0 -57
- package/src/ExpoAudioStream.native.ts +0 -6
- package/src/ExpoAudioStream.types.ts +0 -874
- package/src/ExpoAudioStream.web.ts +0 -905
- package/src/ExpoAudioStreamModule.ts +0 -990
- package/src/WebRecorder.web.ts +0 -1005
- package/src/constants/platformLimitations.ts +0 -118
- package/src/constants.ts +0 -18
- package/src/events.ts +0 -60
- package/src/hooks/useAudioDevices.ts +0 -213
- package/src/index.ts +0 -54
- package/src/trimAudio.ts +0 -94
- package/src/types/crc-32.d.ts +0 -9
- package/src/useAudioRecorder.tsx +0 -766
- package/src/utils/BlobFix.ts +0 -561
- package/src/utils/audioProcessing.ts +0 -205
- package/src/utils/cleanNativeOptions.ts +0 -18
- package/src/utils/concatenateBuffers.ts +0 -24
- package/src/utils/convertPCMToFloat32.ts +0 -170
- package/src/utils/crc32.ts +0 -59
- package/src/utils/encodingToBitDepth.ts +0 -18
- package/src/utils/getWavFileInfo.ts +0 -132
- package/src/utils/writeWavHeader.ts +0 -115
- package/src/workers/InlineFeaturesExtractor.web.tsx +0 -855
- package/src/workers/inlineAudioWebWorker.web.tsx +0 -180
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineFeaturesExtractor.web.js","sourceRoot":"","sources":["../../../src/workers/InlineFeaturesExtractor.web.tsx"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAq1BtC,CAAA","sourcesContent":["// packages/expo-audio-studio/src/workers/InlineFeaturesExtractor.web.tsx\nexport const InlineFeaturesExtractor = `\n// Constants\nconst N_FFT = 1024; // Default FFT size\nconst MAX_FFT_SIZE = 8192; // Maximum FFT size to prevent memory issues\nconst N_CHROMA = 12;\n\n// FFT Implementation with normalized Hann window\nfunction FFT(n) {\n this.n = n;\n this.cosTable = new Float32Array(n / 2);\n this.sinTable = new Float32Array(n / 2);\n this.hannWindow = new Float32Array(n);\n \n // Match Android implementation with precomputed tables\n const normalizationFactor = Math.sqrt(2.0 / n);\n for (var i = 0; i < n / 2; i++) {\n this.cosTable[i] = Math.cos(2.0 * Math.PI * i / n);\n this.sinTable[i] = Math.sin(2.0 * Math.PI * i / n);\n }\n \n // Precompute normalized Hann window to match Android\n for (var i = 0; i < n; i++) {\n this.hannWindow[i] = normalizationFactor * 0.5 * (1 - Math.cos(2.0 * Math.PI * i / (n - 1)));\n }\n}\n\nFFT.prototype.transform = function(data) {\n const n = data.length;\n \n // Validate input length is power of 2\n if ((n & (n - 1)) !== 0) {\n throw new Error('FFT length must be power of 2');\n }\n\n // Use iterative bit reversal instead of recursive\n const bitReversedIndices = new Uint32Array(n);\n for (let i = 0; i < n; i++) {\n let reversed = 0;\n let j = i;\n let bits = Math.log2(n);\n while (bits--) {\n reversed = (reversed << 1) | (j & 1);\n j >>= 1;\n }\n bitReversedIndices[i] = reversed;\n }\n\n // Apply bit reversal\n for (let i = 0; i < n; i++) {\n const j = bitReversedIndices[i];\n if (i < j) {\n const temp = data[i];\n data[i] = data[j];\n data[j] = temp;\n }\n }\n\n // Iterative FFT computation with optimized memory usage\n for (let step = 1; step < n; step <<= 1) {\n const jump = step << 1;\n const angleStep = Math.PI / step;\n\n for (let group = 0; group < n; group += jump) {\n for (let pair = group; pair < group + step; pair++) {\n const match = pair + step;\n const angle = angleStep * (pair - group);\n \n const currentCos = Math.cos(angle);\n const currentSin = Math.sin(angle);\n\n const real = currentCos * data[match] - currentSin * data[match + 1];\n const imag = currentCos * data[match + 1] + currentSin * data[match];\n\n data[match] = data[pair] - real;\n data[match + 1] = data[pair + 1] - imag;\n data[pair] += real;\n data[pair + 1] += imag;\n }\n }\n }\n};\n\n// Add realInverse method\nFFT.prototype.realInverse = function(powerSpectrum, output) {\n const n = powerSpectrum.length;\n const complexData = new Float32Array(n * 2);\n \n // Copy power spectrum to complex format\n for (let i = 0; i < n/2 + 1; i++) {\n complexData[2 * i] = powerSpectrum[i];\n if (2 * i + 1 < complexData.length) {\n complexData[2 * i + 1] = 0;\n }\n }\n \n // Conjugate for inverse FFT\n for (let i = 0; i < n; i++) {\n if (2 * i + 1 < complexData.length) {\n complexData[2 * i + 1] = -complexData[2 * i + 1];\n }\n }\n \n this.transform(complexData);\n \n // Copy real part to output and scale\n for (let i = 0; i < n; i++) {\n output[i] = complexData[2 * i] / n;\n }\n};\n\n// Add helper functions to match Android\nfunction nextPowerOfTwo(n) {\n let value = 1;\n while (value < n) {\n value *= 2;\n }\n return value;\n}\n\nfunction applyHannWindow(samples) {\n const output = new Float32Array(samples.length);\n for (let i = 0; i < samples.length; i++) {\n const multiplier = 0.5 * (1 - Math.cos(2 * Math.PI * i / (samples.length - 1)));\n output[i] = samples[i] * multiplier;\n }\n return output;\n}\n\n// Update spectral feature computation to match Android\nfunction computeSpectralFeatures(segment, sampleRate, featureOptions = {}) {\n try {\n // Early return if no spectral features are requested\n if (!featureOptions.spectralCentroid && \n !featureOptions.spectralFlatness && \n !featureOptions.spectralRollOff && \n !featureOptions.spectralBandwidth &&\n !featureOptions.magnitudeSpectrum) {\n return {\n centroid: 0,\n flatness: 0,\n rollOff: 0,\n bandwidth: 0,\n magnitudeSpectrum: []\n };\n }\n\n // Ensure we have valid data\n if (!segment || segment.length === 0) {\n throw new Error('Invalid segment data');\n }\n\n // Process in fixed-size chunks\n const chunkSize = N_FFT;\n const numChunks = Math.ceil(segment.length / chunkSize);\n \n let results = {\n centroid: 0,\n flatness: 0,\n rollOff: 0,\n bandwidth: 0,\n magnitudeSpectrum: new Float32Array(N_FFT / 2 + 1).fill(0)\n };\n \n let validChunks = 0;\n \n // Iterate through chunks\n for (let i = 0; i < numChunks; i++) {\n const start = i * chunkSize;\n const end = Math.min(start + chunkSize, segment.length);\n const chunk = segment.slice(start, end);\n \n if (chunk.length < N_FFT / 4) continue; // Skip very small chunks\n\n // Process the chunk\n const paddedChunk = new Float32Array(N_FFT);\n paddedChunk.set(applyHannWindow(chunk));\n\n const fft = new FFT(N_FFT);\n fft.transform(paddedChunk);\n\n // Calculate magnitude spectrum\n const chunkMagnitudeSpectrum = new Float32Array(N_FFT / 2 + 1);\n let hasSignal = false;\n \n for (let j = 0; j < N_FFT / 2; j++) {\n const re = paddedChunk[2 * j];\n const im = paddedChunk[2 * j + 1];\n const magnitude = Math.sqrt(re * re + im * im);\n chunkMagnitudeSpectrum[j] = magnitude;\n if (magnitude > Number.EPSILON) hasSignal = true;\n }\n \n if (!hasSignal) continue;\n validChunks++;\n\n // Accumulate results\n if (featureOptions.spectralCentroid) {\n const centroid = computeSpectralCentroid(chunkMagnitudeSpectrum, sampleRate);\n if (!isNaN(centroid)) results.centroid += centroid;\n }\n \n if (featureOptions.spectralFlatness) {\n const flatness = computeSpectralFlatness(chunkMagnitudeSpectrum);\n if (!isNaN(flatness)) results.flatness += flatness;\n }\n \n if (featureOptions.spectralRollOff) {\n const rolloff = computeSpectralRollOff(chunkMagnitudeSpectrum, sampleRate);\n if (!isNaN(rolloff)) results.rollOff += rolloff;\n }\n \n if (featureOptions.spectralBandwidth && !isNaN(results.centroid)) {\n const bandwidth = computeSpectralBandwidth(chunkMagnitudeSpectrum, sampleRate, results.centroid);\n if (!isNaN(bandwidth)) results.bandwidth += bandwidth;\n }\n \n if (featureOptions.magnitudeSpectrum) {\n for (let j = 0; j < results.magnitudeSpectrum.length; j++) {\n results.magnitudeSpectrum[j] += chunkMagnitudeSpectrum[j];\n }\n }\n }\n\n // Average the accumulated results\n if (validChunks > 0) {\n results.centroid /= validChunks;\n results.flatness /= validChunks;\n results.rollOff /= validChunks;\n results.bandwidth /= validChunks;\n \n if (featureOptions.magnitudeSpectrum) {\n for (let i = 0; i < results.magnitudeSpectrum.length; i++) {\n results.magnitudeSpectrum[i] /= validChunks;\n }\n }\n }\n\n return results;\n } catch (error) {\n console.error('[Worker] Spectral feature computation error:', error);\n return {\n centroid: 0,\n flatness: 0,\n rollOff: 0,\n bandwidth: 0,\n magnitudeSpectrum: []\n };\n }\n}\n\nfunction computeSpectralCentroid(magnitudeSpectrum, sampleRate) {\n const sum = magnitudeSpectrum.reduce((a, b) => a + (b || 0), 0);\n if (sum <= Number.EPSILON) return 0;\n \n const weightedSum = magnitudeSpectrum.reduce((acc, value, index) => \n acc + (index * (sampleRate / N_FFT) * (value || 0)), 0);\n \n return weightedSum / sum;\n}\n\nfunction computeSpectralFlatness(powerSpectrum) {\n // Add small epsilon to avoid log(0)\n const epsilon = Number.EPSILON;\n const validSpectrum = powerSpectrum.map(v => Math.max(v, epsilon));\n \n const geometricMean = Math.exp(\n validSpectrum\n .map(v => Math.log(v))\n .reduce((a, b) => a + b) / validSpectrum.length\n );\n \n const arithmeticMean =\n validSpectrum.reduce((a, b) => a + b) / validSpectrum.length;\n \n return geometricMean / arithmeticMean;\n}\n\nfunction computeSpectralRollOff(magnitudeSpectrum, sampleRate) {\n const totalEnergy = magnitudeSpectrum.reduce((a, b) => a + b, 0);\n const rollOffThreshold = totalEnergy * 0.85;\n let cumulativeEnergy = 0;\n\n for (let i = 0; i < magnitudeSpectrum.length; i++) {\n cumulativeEnergy += magnitudeSpectrum[i];\n if (cumulativeEnergy >= rollOffThreshold) {\n return (i / magnitudeSpectrum.length) * (sampleRate / 2);\n }\n }\n\n return 0;\n}\n\nfunction computeSpectralBandwidth(magnitudeSpectrum, sampleRate, centroid) {\n const sum = magnitudeSpectrum.reduce((a, b) => a + (b || 0), 0);\n if (sum <= Number.EPSILON) return 0;\n\n const weightedSum = magnitudeSpectrum.reduce(\n (acc, value, index) => {\n const freq = index * sampleRate / (2 * magnitudeSpectrum.length);\n return acc + (value || 0) * Math.pow(freq - centroid, 2);\n }, 0\n );\n\n return Math.sqrt(weightedSum / sum);\n}\n\nfunction computeChroma(segmentData, sampleRate) {\n // Ensure we have valid input data\n if (!segmentData || segmentData.length === 0) {\n return new Array(N_CHROMA).fill(0);\n }\n\n const fftLength = nextPowerOfTwo(Math.max(segmentData.length, N_FFT));\n const windowed = applyHannWindow(segmentData);\n const padded = new Float32Array(fftLength);\n padded.set(windowed.slice(0, Math.min(windowed.length, fftLength)));\n\n const fft = new FFT(fftLength);\n try {\n fft.transform(padded);\n } catch (e) {\n console.error('[Worker] FFT transform failed in chromagram:', e);\n return new Array(N_CHROMA).fill(0);\n }\n\n const chroma = new Float32Array(N_CHROMA).fill(0);\n const freqsPerBin = sampleRate / fftLength;\n let totalEnergy = 0;\n\n // First pass: compute magnitudes and total energy\n for (let i = 0; i < fftLength / 2; i++) {\n const freq = i * freqsPerBin;\n if (freq > 20) { // Only consider frequencies above 20 Hz\n const re = padded[2 * i];\n const im = padded[2 * i + 1] || 0;\n const magnitude = Math.sqrt(re * re + im * im);\n \n if (magnitude > Number.EPSILON) {\n // Use a more stable pitch class calculation\n const midiNote = 69 + 12 * Math.log2(freq / 440.0);\n const pitchClass = Math.round(midiNote) % 12;\n \n if (pitchClass >= 0 && pitchClass < 12) {\n chroma[pitchClass] += magnitude;\n totalEnergy += magnitude;\n }\n }\n }\n }\n\n // Normalize chroma values only if we have energy\n if (totalEnergy > Number.EPSILON) {\n for (let i = 0; i < N_CHROMA; i++) {\n chroma[i] = chroma[i] / totalEnergy;\n }\n }\n\n // Convert to regular array and ensure no NaN values\n return Array.from(chroma, v => isNaN(v) ? 0 : v);\n}\n\nfunction extractHNR(segmentData) {\n const frameSize = segmentData.length;\n const autocorrelation = new Float32Array(frameSize);\n\n // Compute the autocorrelation iteratively\n for (let i = 0; i < frameSize; i++) {\n let sum = 0;\n for (let j = 0; j < frameSize - i; j++) {\n sum += segmentData[j] * segmentData[j + i];\n }\n autocorrelation[i] = sum;\n }\n\n // Find the maximum autocorrelation value iteratively\n let maxAutocorrelation = -Infinity;\n for (let i = 1; i < autocorrelation.length; i++) {\n if (autocorrelation[i] > maxAutocorrelation) {\n maxAutocorrelation = autocorrelation[i];\n }\n }\n\n // Compute the HNR\n return autocorrelation[0] !== 0\n ? 10 * Math.log10(maxAutocorrelation / (autocorrelation[0] - maxAutocorrelation))\n : 0;\n}\n\nfunction estimatePitch(segment, sampleRate) {\n // Early validation\n if (!segment || segment.length < 2 || !sampleRate) return 0;\n\n try {\n // Apply Hann window\n const windowed = applyHannWindow(segment);\n\n // Pad for FFT\n const fftLength = nextPowerOfTwo(segment.length * 2);\n const padded = new Float32Array(fftLength);\n padded.set(windowed);\n\n // Perform FFT\n const fft = new FFT(fftLength);\n fft.transform(padded);\n\n // Compute power spectrum\n const powerSpectrum = new Float32Array(fftLength / 2 + 1);\n for (let i = 0; i <= fftLength / 2; i++) {\n const re = padded[2 * i];\n const im = padded[2 * i + 1] || 0;\n powerSpectrum[i] = re * re + im * im;\n }\n\n // Find peak frequency\n let maxPower = 0;\n let peakIndex = 0;\n const minFreq = 50; // Minimum frequency to consider (Hz)\n const maxFreq = 1000; // Maximum frequency to consider (Hz)\n const minBin = Math.floor(minFreq * fftLength / sampleRate);\n const maxBin = Math.ceil(maxFreq * fftLength / sampleRate);\n\n for (let i = minBin; i <= maxBin; i++) {\n if (powerSpectrum[i] > maxPower) {\n maxPower = powerSpectrum[i];\n peakIndex = i;\n }\n }\n\n // Convert peak index to frequency\n const fundamentalFreq = peakIndex * sampleRate / fftLength;\n\n // Return 0 if the detected frequency is outside reasonable bounds\n return (fundamentalFreq >= minFreq && fundamentalFreq <= maxFreq) ? \n fundamentalFreq : 0;\n\n } catch (error) {\n console.error('[Worker] Pitch estimation error:', error);\n return 0;\n }\n}\n\n// Unique ID counter - the only state we need to maintain\nlet uniqueIdCounter = 0\nlet lastEmitTime = Date.now()\n\nself.onmessage = function (event) {\n // Extract enableLogging early so we can use it consistently\n const enableLogging = event.data.enableLogging || false;\n \n // Create consistent logger that only logs when enabled\n const logger = enableLogging ? {\n debug: (...args) => console.debug('[Worker]', ...args),\n log: (...args) => console.log('[Worker]', ...args),\n warn: (...args) => console.warn('[Worker]', ...args),\n error: (...args) => console.error('[Worker]', ...args)\n } : {\n debug: () => {},\n log: () => {},\n warn: () => {},\n error: () => {}\n };\n \n // Check if this is a reset command\n if (event.data.command === 'resetCounter') {\n const newValue = event.data.value;\n logger.log('Reset counter request received with value:', newValue);\n \n // Always respect explicit resets through the resetCounter command\n uniqueIdCounter = typeof newValue === 'number' ? newValue : 0;\n logger.log('Counter explicitly set to:', uniqueIdCounter);\n \n return; // Exit early, don't process audio\n }\n\n // Regular audio processing\n const {\n channelData,\n sampleRate,\n segmentDurationMs,\n algorithm,\n bitDepth,\n fullAudioDurationMs,\n numberOfChannels,\n features: _features,\n intervalAnalysis = 500,\n } = event.data\n\n // Calculate subChunkStartTime safely, defaulting to 0 if fullAudioDurationMs is not a valid number\n const subChunkStartTime = (typeof fullAudioDurationMs === 'number' && !isNaN(fullAudioDurationMs) && fullAudioDurationMs >= 0)\n ? fullAudioDurationMs / 1000\n : 0;\n\n const features = _features || {}\n const bytesPerSample = bitDepth / 8; // Calculate bytes per sample\n\n const SILENCE_THRESHOLD = 0.01\n const MIN_SILENCE_DURATION = 1.5 * sampleRate // 1.5 seconds of silence\n const SPEECH_INERTIA_DURATION = 0.1 * sampleRate // Speech inertia duration in samples\n const RMS_THRESHOLD = 0.01\n const ZCR_THRESHOLD = 0.1\n\n // Placeholder functions for feature extraction\n const extractMFCC = (segmentData, sampleRate) => {\n // Implement MFCC extraction logic here\n return []\n }\n\n const extractSpectralCentroid = (segmentData, sampleRate) => {\n const magnitudeSpectrum = segmentData.map((v) => v * v)\n const sum = magnitudeSpectrum.reduce((a, b) => a + b, 0)\n if (sum === 0) return 0\n\n const weightedSum = magnitudeSpectrum.reduce(\n (acc, value, index) => acc + index * value,\n 0\n )\n return (\n ((weightedSum / sum) * (sampleRate / 2)) / magnitudeSpectrum.length\n )\n }\n\n const extractSpectralFlatness = (segmentData) => {\n const magnitudeSpectrum = segmentData.map((v) => Math.abs(v))\n const geometricMean = Math.exp(\n magnitudeSpectrum\n .map((v) => Math.log(v + Number.MIN_VALUE))\n .reduce((a, b) => a + b) / magnitudeSpectrum.length\n )\n const arithmeticMean =\n magnitudeSpectrum.reduce((a, b) => a + b) / magnitudeSpectrum.length\n return arithmeticMean === 0 ? 0 : geometricMean / arithmeticMean\n }\n\n const extractSpectralRollOff = (segmentData, sampleRate) => {\n const magnitudeSpectrum = segmentData.map((v) => Math.abs(v))\n const totalEnergy = magnitudeSpectrum.reduce((a, b) => a + b, 0)\n const rollOffThreshold = totalEnergy * 0.85\n let cumulativeEnergy = 0\n\n for (let i = 0; i < magnitudeSpectrum.length; i++) {\n cumulativeEnergy += magnitudeSpectrum[i]\n if (cumulativeEnergy >= rollOffThreshold) {\n return (i / magnitudeSpectrum.length) * (sampleRate / 2)\n }\n }\n\n return 0\n }\n\n const extractSpectralBandwidth = (segmentData, sampleRate) => {\n const centroid = extractSpectralCentroid(segmentData, sampleRate)\n const magnitudeSpectrum = segmentData.map((v) => Math.abs(v))\n const sum = magnitudeSpectrum.reduce((a, b) => a + b, 0)\n if (sum === 0) return 0\n\n const weightedSum = magnitudeSpectrum.reduce(\n (acc, value, index) => acc + value * Math.pow(index - centroid, 2),\n 0\n )\n return Math.sqrt(weightedSum / sum)\n }\n\n const extractChromagram = (segmentData, sampleRate) => {\n return [] // TODO implement\n }\n\n /**\n * Creates a features object based on requested features\n */\n function createFeaturesObject(\n features,\n maxAmp,\n rms,\n sumSquares,\n zeroCrossings,\n remainingSamples,\n spectralFeatures,\n channelData,\n startIdx,\n endIdx,\n sampleRate,\n numberOfChannels,\n bytesPerSample\n ) {\n // If no features are requested, return undefined\n if (!Object.values(features).some(function(v) { return v; })) {\n return undefined;\n }\n\n const result = {};\n \n if (features.energy) {\n result.energy = sumSquares;\n }\n if (features.rms) {\n result.rms = rms;\n }\n // Always include min/max amplitude if any features are requested\n result.minAmplitude = -maxAmp;\n result.maxAmplitude = maxAmp;\n \n if (features.zcr) {\n result.zcr = zeroCrossings / remainingSamples;\n }\n if (features.spectralCentroid) {\n result.spectralCentroid = spectralFeatures.centroid;\n }\n if (features.spectralFlatness) {\n result.spectralFlatness = spectralFeatures.flatness;\n }\n if (features.spectralRolloff) {\n result.spectralRolloff = spectralFeatures.rollOff;\n }\n if (features.spectralBandwidth) {\n result.spectralBandwidth = spectralFeatures.bandwidth;\n }\n if (features.chromagram) {\n result.chromagram = computeChroma(channelData.slice(startIdx, endIdx), sampleRate);\n }\n if (features.hnr) {\n result.hnr = extractHNR(channelData.slice(startIdx, endIdx));\n }\n if (features.pitch) {\n result.pitch = estimatePitch(channelData.slice(startIdx, endIdx), sampleRate);\n }\n \n return result;\n }\n\n function extractWaveform(\n channelData,\n sampleRate,\n segmentDurationMs,\n numberOfChannels,\n bytesPerSample\n ) {\n const logger = enableLogging ? {\n debug: (...args) => console.debug('[Worker]', ...args),\n log: (...args) => console.log('[Worker]', ...args),\n error: (...args) => console.error('[Worker]', ...args)\n } : {\n debug: () => {},\n log: () => {},\n error: () => {}\n }\n\n // Calculate amplitude range\n let min = Infinity\n let max = -Infinity\n for (let i = 0; i < channelData.length; i++) {\n min = Math.min(min, channelData[i])\n max = Math.max(max, channelData[i])\n }\n\n const totalSamples = channelData.length\n const durationMs = (totalSamples / sampleRate) * 1000\n \n // Calculate fixed segment sizes\n const samplesPerSegment = Math.floor(sampleRate * (segmentDurationMs / 1000));\n const numPoints = Math.floor(totalSamples / samplesPerSegment);\n const remainingSamples = totalSamples % samplesPerSegment;\n\n const dataPoints = []\n\n // Process full segments\n for (let i = 0; i < numPoints; i++) {\n const startIdx = i * samplesPerSegment\n const endIdx = startIdx + samplesPerSegment\n \n let sumSquares = 0\n let maxAmp = 0\n let zeroCrossings = 0\n\n // Calculate segment features\n for (let j = startIdx; j < endIdx; j++) {\n const value = channelData[j]\n sumSquares += value * value\n maxAmp = Math.max(maxAmp, Math.abs(value))\n if (j > 0 && value * channelData[j - 1] < 0) {\n zeroCrossings++\n }\n }\n\n const rms = Math.sqrt(sumSquares / samplesPerSegment)\n const startTime = subChunkStartTime + (startIdx / sampleRate)\n const endTime = subChunkStartTime + (endIdx / sampleRate)\n // Calculate byte positions correctly based on numberOfChannels and bytesPerSample\n const startPosition = startIdx * numberOfChannels * bytesPerSample\n const endPosition = endIdx * numberOfChannels * bytesPerSample\n\n var spectralFeatures = computeSpectralFeatures(channelData.slice(startIdx, endIdx), sampleRate, features);\n\n // Simply use the counter, increment after assigning\n const dataPoint = {\n id: uniqueIdCounter++,\n amplitude: maxAmp,\n rms,\n startTime,\n endTime,\n dB: 20 * Math.log10(rms + 1e-6),\n silent: rms < 0.01,\n startPosition,\n endPosition,\n samples: samplesPerSegment,\n }\n\n // Extract features if any are requested\n const extractedFeatures = createFeaturesObject(\n features,\n maxAmp,\n rms,\n sumSquares,\n zeroCrossings,\n samplesPerSegment,\n spectralFeatures,\n channelData,\n startIdx,\n endIdx,\n sampleRate,\n numberOfChannels,\n bytesPerSample\n );\n \n if (extractedFeatures) {\n dataPoint.features = extractedFeatures;\n }\n\n dataPoints.push(dataPoint)\n }\n\n // Handle remaining samples if they exist and are enough to process\n if (remainingSamples > samplesPerSegment / 4) { // Only process if we have at least 1/4 of a segment\n const startIdx = numPoints * samplesPerSegment\n const endIdx = totalSamples\n \n let sumSquares = 0\n let maxAmp = 0\n let zeroCrossings = 0\n\n for (let j = startIdx; j < endIdx; j++) {\n const value = channelData[j]\n sumSquares += value * value\n maxAmp = Math.max(maxAmp, Math.abs(value))\n if (j > 0 && value * channelData[j - 1] < 0) {\n zeroCrossings++\n }\n }\n\n const rms = Math.sqrt(sumSquares / remainingSamples)\n const startTime = subChunkStartTime + (startIdx / sampleRate);\n const endTime = subChunkStartTime + (endIdx / sampleRate);\n // Calculate byte positions correctly based on numberOfChannels and bytesPerSample\n const startPosition = startIdx * numberOfChannels * bytesPerSample\n const endPosition = endIdx * numberOfChannels * bytesPerSample\n\n var spectralFeatures = computeSpectralFeatures(channelData.slice(startIdx, endIdx), sampleRate, features);\n\n // Simply use the counter, increment after assigning\n const dataPoint = {\n id: uniqueIdCounter++,\n amplitude: maxAmp,\n rms,\n startTime,\n endTime,\n dB: 20 * Math.log10(rms + 1e-6),\n silent: rms < 0.01,\n startPosition,\n endPosition,\n samples: remainingSamples,\n }\n\n logger.debug('extractWaveform - dataPoint', dataPoint);\n // Extract features if any are requested\n const extractedFeatures = createFeaturesObject(\n features,\n maxAmp,\n rms,\n sumSquares,\n zeroCrossings,\n remainingSamples,\n spectralFeatures,\n channelData,\n startIdx,\n endIdx,\n sampleRate,\n numberOfChannels,\n bytesPerSample\n );\n \n if (extractedFeatures) {\n dataPoint.features = extractedFeatures;\n }\n\n dataPoints.push(dataPoint)\n }\n\n return {\n durationMs,\n dataPoints,\n amplitudeRange: { min, max },\n rmsRange: {\n min: 0,\n max: Math.max(Math.abs(min), Math.abs(max))\n }\n }\n }\n\n try {\n // Measure actual processing time using performance.now() for higher precision\n const processingStartTime = performance.now()\n \n const result = extractWaveform(\n channelData,\n sampleRate,\n segmentDurationMs,\n numberOfChannels || 1, // Default to 1 channel if not provided\n bytesPerSample\n )\n \n const processingEndTime = performance.now()\n const actualExtractionTimeMs = processingEndTime - processingStartTime\n\n // Send complete result immediately\n self.postMessage({\n command: 'features',\n result: {\n bitDepth,\n samples: channelData.length,\n numberOfChannels,\n sampleRate,\n segmentDurationMs,\n durationMs: result.durationMs,\n dataPoints: result.dataPoints,\n amplitudeRange: result.amplitudeRange,\n rmsRange: result.rmsRange,\n extractionTimeMs: actualExtractionTimeMs,\n }\n })\n } catch (error) {\n console.error('[Worker] Error', {\n message: error.message,\n stack: error.stack\n });\n \n self.postMessage({ \n error: {\n message: error.message,\n stack: error.stack,\n name: error.name\n }\n });\n }\n}\n`\n"]}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
// packages/expo-audio-stream/src/workers/inlineAudioWebWorker.web.tsx
|
|
2
|
-
export const InlineAudioWebWorker = `
|
|
3
|
-
const DEFAULT_BIT_DEPTH = 32
|
|
4
|
-
const DEFAULT_SAMPLE_RATE = 44100
|
|
5
|
-
|
|
6
|
-
class RecorderProcessor extends AudioWorkletProcessor {
|
|
7
|
-
constructor() {
|
|
8
|
-
super()
|
|
9
|
-
this.currentChunk = [] // Float32Array
|
|
10
|
-
this.samplesSinceLastExport = 0
|
|
11
|
-
this.recordSampleRate = DEFAULT_SAMPLE_RATE
|
|
12
|
-
this.exportSampleRate = DEFAULT_SAMPLE_RATE
|
|
13
|
-
this.recordBitDepth = DEFAULT_BIT_DEPTH
|
|
14
|
-
this.exportBitDepth = DEFAULT_BIT_DEPTH
|
|
15
|
-
this.numberOfChannels = 1
|
|
16
|
-
this.isRecording = true
|
|
17
|
-
this.port.onmessage = this.handleMessage.bind(this)
|
|
18
|
-
this.enableLogging = false
|
|
19
|
-
this.exportIntervalSamples = 0
|
|
20
|
-
this.currentPosition = 0 // Track current position in seconds
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
handleMessage(event) {
|
|
24
|
-
switch (event.data.command) {
|
|
25
|
-
case 'init':
|
|
26
|
-
this.enableLogging = event.data.enableLogging || false
|
|
27
|
-
this.recordSampleRate = event.data.recordSampleRate
|
|
28
|
-
this.exportSampleRate =
|
|
29
|
-
event.data.exportSampleRate || event.data.recordSampleRate
|
|
30
|
-
this.exportIntervalSamples =
|
|
31
|
-
this.recordSampleRate * (event.data.interval / 1000)
|
|
32
|
-
if (event.data.numberOfChannels) {
|
|
33
|
-
this.numberOfChannels = event.data.numberOfChannels
|
|
34
|
-
}
|
|
35
|
-
if (event.data.recordBitDepth) {
|
|
36
|
-
this.recordBitDepth = event.data.recordBitDepth
|
|
37
|
-
}
|
|
38
|
-
this.exportBitDepth =
|
|
39
|
-
event.data.exportBitDepth || this.recordBitDepth
|
|
40
|
-
|
|
41
|
-
// Handle position parameter for device switching
|
|
42
|
-
if (typeof event.data.position === 'number' && event.data.position > 0) {
|
|
43
|
-
this.currentPosition = event.data.position
|
|
44
|
-
if (this.enableLogging) {
|
|
45
|
-
console.log('AudioWorklet initialized with position:', this.currentPosition)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
break
|
|
49
|
-
|
|
50
|
-
case 'stop':
|
|
51
|
-
this.isRecording = false
|
|
52
|
-
if (this.currentChunk.length > 0) {
|
|
53
|
-
this.processChunk()
|
|
54
|
-
}
|
|
55
|
-
break
|
|
56
|
-
|
|
57
|
-
case 'pause':
|
|
58
|
-
// Just a placeholder for pause handling
|
|
59
|
-
break
|
|
60
|
-
|
|
61
|
-
case 'resume':
|
|
62
|
-
// Just a placeholder for resume handling
|
|
63
|
-
break
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
process(inputs, _outputs, _parameters) {
|
|
68
|
-
if (!this.isRecording) return true
|
|
69
|
-
const input = inputs[0]
|
|
70
|
-
if (input.length > 0) {
|
|
71
|
-
const newBuffer = new Float32Array(input[0])
|
|
72
|
-
this.currentChunk.push(newBuffer)
|
|
73
|
-
this.samplesSinceLastExport += newBuffer.length
|
|
74
|
-
|
|
75
|
-
if (this.samplesSinceLastExport >= this.exportIntervalSamples) {
|
|
76
|
-
this.processChunk()
|
|
77
|
-
this.samplesSinceLastExport = 0
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return true
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
mergeBuffers(bufferArray, recLength) {
|
|
84
|
-
const result = new Float32Array(recLength)
|
|
85
|
-
let offset = 0
|
|
86
|
-
for (let i = 0; i < bufferArray.length; i++) {
|
|
87
|
-
result.set(bufferArray[i], offset)
|
|
88
|
-
offset += bufferArray[i].length
|
|
89
|
-
}
|
|
90
|
-
return result
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Keep basic resampling for sample rate conversion
|
|
94
|
-
resample(samples, targetSampleRate) {
|
|
95
|
-
if (this.recordSampleRate === targetSampleRate) {
|
|
96
|
-
return samples
|
|
97
|
-
}
|
|
98
|
-
const resampledBuffer = new Float32Array(
|
|
99
|
-
Math.ceil(
|
|
100
|
-
(samples.length * targetSampleRate) / this.recordSampleRate
|
|
101
|
-
)
|
|
102
|
-
)
|
|
103
|
-
const ratio = this.recordSampleRate / targetSampleRate
|
|
104
|
-
let offset = 0
|
|
105
|
-
for (let i = 0; i < resampledBuffer.length; i++) {
|
|
106
|
-
const nextOffset = Math.floor((i + 1) * ratio)
|
|
107
|
-
let accum = 0
|
|
108
|
-
let count = 0
|
|
109
|
-
for (let j = offset; j < nextOffset && j < samples.length; j++) {
|
|
110
|
-
accum += samples[j]
|
|
111
|
-
count++
|
|
112
|
-
}
|
|
113
|
-
resampledBuffer[i] = count > 0 ? accum / count : 0
|
|
114
|
-
offset = nextOffset
|
|
115
|
-
}
|
|
116
|
-
return resampledBuffer
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Keep bit depth conversion if needed
|
|
120
|
-
convertBitDepth(input, targetBitDepth) {
|
|
121
|
-
if (targetBitDepth === 32) {
|
|
122
|
-
const output = new Int32Array(input.length)
|
|
123
|
-
for (let i = 0; i < input.length; i++) {
|
|
124
|
-
const s = Math.max(-1, Math.min(1, input[i]))
|
|
125
|
-
output[i] = s < 0 ? s * 0x80000000 : s * 0x7fffffff
|
|
126
|
-
}
|
|
127
|
-
return output
|
|
128
|
-
} else if (targetBitDepth === 16) {
|
|
129
|
-
const output = new Int16Array(input.length)
|
|
130
|
-
for (let i = 0; i < input.length; i++) {
|
|
131
|
-
const s = Math.max(-1, Math.min(1, input[i]))
|
|
132
|
-
output[i] = s < 0 ? s * 0x8000 : s * 0x7fff
|
|
133
|
-
}
|
|
134
|
-
return output
|
|
135
|
-
}
|
|
136
|
-
return input
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
processChunk() {
|
|
140
|
-
if (this.currentChunk.length === 0) return
|
|
141
|
-
|
|
142
|
-
// Merge buffers
|
|
143
|
-
const chunkLength = this.currentChunk.reduce(
|
|
144
|
-
(acc, buf) => acc + buf.length,
|
|
145
|
-
0
|
|
146
|
-
)
|
|
147
|
-
const mergedChunk = this.mergeBuffers(this.currentChunk, chunkLength)
|
|
148
|
-
|
|
149
|
-
// Resample if needed
|
|
150
|
-
const resampledChunk = this.resample(mergedChunk, this.exportSampleRate)
|
|
151
|
-
|
|
152
|
-
// Convert bit depth if needed
|
|
153
|
-
const finalBuffer =
|
|
154
|
-
this.recordBitDepth !== this.exportBitDepth
|
|
155
|
-
? this.convertBitDepth(resampledChunk, this.exportBitDepth)
|
|
156
|
-
: resampledChunk
|
|
157
|
-
|
|
158
|
-
// Calculate the duration in seconds
|
|
159
|
-
const chunkDuration = finalBuffer.length / this.exportSampleRate
|
|
160
|
-
|
|
161
|
-
// Send processed chunk with the current position
|
|
162
|
-
this.port.postMessage({
|
|
163
|
-
command: 'newData',
|
|
164
|
-
recordedData: finalBuffer,
|
|
165
|
-
sampleRate: this.exportSampleRate,
|
|
166
|
-
bitDepth: this.exportBitDepth,
|
|
167
|
-
numberOfChannels: this.numberOfChannels,
|
|
168
|
-
position: this.currentPosition,
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
// Update the position
|
|
172
|
-
this.currentPosition += chunkDuration
|
|
173
|
-
|
|
174
|
-
// Clear the current chunk
|
|
175
|
-
this.currentChunk = []
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
registerProcessor('recorder-processor', RecorderProcessor)
|
|
180
|
-
`;
|
|
181
|
-
//# sourceMappingURL=inlineAudioWebWorker.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inlineAudioWebWorker.web.js","sourceRoot":"","sources":["../../../src/workers/inlineAudioWebWorker.web.tsx"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkLnC,CAAA","sourcesContent":["// packages/expo-audio-stream/src/workers/inlineAudioWebWorker.web.tsx\nexport const InlineAudioWebWorker = `\nconst DEFAULT_BIT_DEPTH = 32\nconst DEFAULT_SAMPLE_RATE = 44100\n\nclass RecorderProcessor extends AudioWorkletProcessor {\n constructor() {\n super()\n this.currentChunk = [] // Float32Array\n this.samplesSinceLastExport = 0\n this.recordSampleRate = DEFAULT_SAMPLE_RATE\n this.exportSampleRate = DEFAULT_SAMPLE_RATE\n this.recordBitDepth = DEFAULT_BIT_DEPTH\n this.exportBitDepth = DEFAULT_BIT_DEPTH\n this.numberOfChannels = 1\n this.isRecording = true\n this.port.onmessage = this.handleMessage.bind(this)\n this.enableLogging = false\n this.exportIntervalSamples = 0\n this.currentPosition = 0 // Track current position in seconds\n }\n\n handleMessage(event) {\n switch (event.data.command) {\n case 'init':\n this.enableLogging = event.data.enableLogging || false\n this.recordSampleRate = event.data.recordSampleRate\n this.exportSampleRate =\n event.data.exportSampleRate || event.data.recordSampleRate\n this.exportIntervalSamples =\n this.recordSampleRate * (event.data.interval / 1000)\n if (event.data.numberOfChannels) {\n this.numberOfChannels = event.data.numberOfChannels\n }\n if (event.data.recordBitDepth) {\n this.recordBitDepth = event.data.recordBitDepth\n }\n this.exportBitDepth =\n event.data.exportBitDepth || this.recordBitDepth\n \n // Handle position parameter for device switching\n if (typeof event.data.position === 'number' && event.data.position > 0) {\n this.currentPosition = event.data.position\n if (this.enableLogging) {\n console.log('AudioWorklet initialized with position:', this.currentPosition)\n }\n }\n break\n\n case 'stop':\n this.isRecording = false\n if (this.currentChunk.length > 0) {\n this.processChunk()\n }\n break\n \n case 'pause':\n // Just a placeholder for pause handling\n break\n \n case 'resume':\n // Just a placeholder for resume handling\n break\n }\n }\n\n process(inputs, _outputs, _parameters) {\n if (!this.isRecording) return true\n const input = inputs[0]\n if (input.length > 0) {\n const newBuffer = new Float32Array(input[0])\n this.currentChunk.push(newBuffer)\n this.samplesSinceLastExport += newBuffer.length\n\n if (this.samplesSinceLastExport >= this.exportIntervalSamples) {\n this.processChunk()\n this.samplesSinceLastExport = 0\n }\n }\n return true\n }\n\n mergeBuffers(bufferArray, recLength) {\n const result = new Float32Array(recLength)\n let offset = 0\n for (let i = 0; i < bufferArray.length; i++) {\n result.set(bufferArray[i], offset)\n offset += bufferArray[i].length\n }\n return result\n }\n\n // Keep basic resampling for sample rate conversion\n resample(samples, targetSampleRate) {\n if (this.recordSampleRate === targetSampleRate) {\n return samples\n }\n const resampledBuffer = new Float32Array(\n Math.ceil(\n (samples.length * targetSampleRate) / this.recordSampleRate\n )\n )\n const ratio = this.recordSampleRate / targetSampleRate\n let offset = 0\n for (let i = 0; i < resampledBuffer.length; i++) {\n const nextOffset = Math.floor((i + 1) * ratio)\n let accum = 0\n let count = 0\n for (let j = offset; j < nextOffset && j < samples.length; j++) {\n accum += samples[j]\n count++\n }\n resampledBuffer[i] = count > 0 ? accum / count : 0\n offset = nextOffset\n }\n return resampledBuffer\n }\n\n // Keep bit depth conversion if needed\n convertBitDepth(input, targetBitDepth) {\n if (targetBitDepth === 32) {\n const output = new Int32Array(input.length)\n for (let i = 0; i < input.length; i++) {\n const s = Math.max(-1, Math.min(1, input[i]))\n output[i] = s < 0 ? s * 0x80000000 : s * 0x7fffffff\n }\n return output\n } else if (targetBitDepth === 16) {\n const output = new Int16Array(input.length)\n for (let i = 0; i < input.length; i++) {\n const s = Math.max(-1, Math.min(1, input[i]))\n output[i] = s < 0 ? s * 0x8000 : s * 0x7fff\n }\n return output\n }\n return input\n }\n\n processChunk() {\n if (this.currentChunk.length === 0) return\n\n // Merge buffers\n const chunkLength = this.currentChunk.reduce(\n (acc, buf) => acc + buf.length,\n 0\n )\n const mergedChunk = this.mergeBuffers(this.currentChunk, chunkLength)\n\n // Resample if needed\n const resampledChunk = this.resample(mergedChunk, this.exportSampleRate)\n\n // Convert bit depth if needed\n const finalBuffer =\n this.recordBitDepth !== this.exportBitDepth\n ? this.convertBitDepth(resampledChunk, this.exportBitDepth)\n : resampledChunk\n\n // Calculate the duration in seconds\n const chunkDuration = finalBuffer.length / this.exportSampleRate\n \n // Send processed chunk with the current position\n this.port.postMessage({\n command: 'newData',\n recordedData: finalBuffer,\n sampleRate: this.exportSampleRate,\n bitDepth: this.exportBitDepth,\n numberOfChannels: this.numberOfChannels,\n position: this.currentPosition,\n })\n \n // Update the position\n this.currentPosition += chunkDuration\n\n // Clear the current chunk\n this.currentChunk = []\n }\n}\n\nregisterProcessor('recorder-processor', RecorderProcessor)\n`\n"]}
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { BitDepth, ConsoleLike } from '../ExpoAudioStream.types';
|
|
2
|
-
/**
|
|
3
|
-
* Represents the configuration for decoding audio data.
|
|
4
|
-
*/
|
|
5
|
-
export interface DecodingConfig {
|
|
6
|
-
/** Target sample rate for decoded audio (Android and Web) */
|
|
7
|
-
targetSampleRate?: number;
|
|
8
|
-
/** Target number of channels (Android and Web) */
|
|
9
|
-
targetChannels?: number;
|
|
10
|
-
/** Target bit depth (Android and Web) */
|
|
11
|
-
targetBitDepth?: BitDepth;
|
|
12
|
-
/** Whether to normalize audio levels (Android and Web) */
|
|
13
|
-
normalizeAudio?: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Represents speech-related features extracted from audio.
|
|
17
|
-
*/
|
|
18
|
-
export interface SpeechFeatures {
|
|
19
|
-
isActive: boolean;
|
|
20
|
-
speakerId?: number;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Represents various audio features extracted from an audio signal.
|
|
24
|
-
*/
|
|
25
|
-
export interface AudioFeatures {
|
|
26
|
-
energy?: number;
|
|
27
|
-
mfcc?: number[];
|
|
28
|
-
rms?: number;
|
|
29
|
-
minAmplitude?: number;
|
|
30
|
-
maxAmplitude?: number;
|
|
31
|
-
zcr?: number;
|
|
32
|
-
spectralCentroid?: number;
|
|
33
|
-
spectralFlatness?: number;
|
|
34
|
-
spectralRolloff?: number;
|
|
35
|
-
spectralBandwidth?: number;
|
|
36
|
-
chromagram?: number[];
|
|
37
|
-
tempo?: number;
|
|
38
|
-
hnr?: number;
|
|
39
|
-
melSpectrogram?: number[];
|
|
40
|
-
spectralContrast?: number[];
|
|
41
|
-
tonnetz?: number[];
|
|
42
|
-
pitch?: number;
|
|
43
|
-
crc32?: number;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Options to specify which audio features to extract.
|
|
47
|
-
* Note: Advanced features (spectral features, chromagram, pitch, etc.) are experimental,
|
|
48
|
-
* especially during live recording, due to high processing requirements.
|
|
49
|
-
*/
|
|
50
|
-
export interface AudioFeaturesOptions {
|
|
51
|
-
energy?: boolean;
|
|
52
|
-
rms?: boolean;
|
|
53
|
-
zcr?: boolean;
|
|
54
|
-
mfcc?: boolean;
|
|
55
|
-
spectralCentroid?: boolean;
|
|
56
|
-
spectralFlatness?: boolean;
|
|
57
|
-
spectralRolloff?: boolean;
|
|
58
|
-
spectralBandwidth?: boolean;
|
|
59
|
-
chromagram?: boolean;
|
|
60
|
-
tempo?: boolean;
|
|
61
|
-
hnr?: boolean;
|
|
62
|
-
melSpectrogram?: boolean;
|
|
63
|
-
spectralContrast?: boolean;
|
|
64
|
-
tonnetz?: boolean;
|
|
65
|
-
pitch?: boolean;
|
|
66
|
-
crc32?: boolean;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Represents a single data point in the audio analysis.
|
|
70
|
-
*/
|
|
71
|
-
export interface DataPoint {
|
|
72
|
-
id: number;
|
|
73
|
-
amplitude: number;
|
|
74
|
-
rms: number;
|
|
75
|
-
dB: number;
|
|
76
|
-
silent: boolean;
|
|
77
|
-
features?: AudioFeatures;
|
|
78
|
-
speech?: SpeechFeatures;
|
|
79
|
-
startTime?: number;
|
|
80
|
-
endTime?: number;
|
|
81
|
-
startPosition?: number;
|
|
82
|
-
endPosition?: number;
|
|
83
|
-
samples?: number;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Represents the complete data from the audio analysis.
|
|
87
|
-
*/
|
|
88
|
-
export interface AudioAnalysis {
|
|
89
|
-
segmentDurationMs: number;
|
|
90
|
-
durationMs: number;
|
|
91
|
-
/**
|
|
92
|
-
* Bit depth used for audio analysis processing.
|
|
93
|
-
*
|
|
94
|
-
* **Important**: This represents the internal processing bit depth, which may differ
|
|
95
|
-
* from the recording bit depth. Audio is typically converted to 32-bit float for
|
|
96
|
-
* analysis to ensure precision in calculations, regardless of the original recording format.
|
|
97
|
-
*
|
|
98
|
-
* Platform behavior:
|
|
99
|
-
* - iOS: Always 32 (float processing)
|
|
100
|
-
* - Android: Always 32 (float processing)
|
|
101
|
-
* - Web: Always 32 (Web Audio API standard)
|
|
102
|
-
*
|
|
103
|
-
* The actual recorded file will maintain the requested bit depth (8, 16, or 32).
|
|
104
|
-
*/
|
|
105
|
-
bitDepth: number;
|
|
106
|
-
samples: number;
|
|
107
|
-
numberOfChannels: number;
|
|
108
|
-
sampleRate: number;
|
|
109
|
-
dataPoints: DataPoint[];
|
|
110
|
-
amplitudeRange: {
|
|
111
|
-
min: number;
|
|
112
|
-
max: number;
|
|
113
|
-
};
|
|
114
|
-
rmsRange: {
|
|
115
|
-
min: number;
|
|
116
|
-
max: number;
|
|
117
|
-
};
|
|
118
|
-
extractionTimeMs: number;
|
|
119
|
-
speechAnalysis?: {
|
|
120
|
-
speakerChanges: {
|
|
121
|
-
timestamp: number;
|
|
122
|
-
speakerId: number;
|
|
123
|
-
}[];
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Options for specifying a time range within an audio file.
|
|
128
|
-
*/
|
|
129
|
-
export interface AudioRangeOptions {
|
|
130
|
-
/** Start time in milliseconds */
|
|
131
|
-
startTimeMs?: number;
|
|
132
|
-
/** End time in milliseconds */
|
|
133
|
-
endTimeMs?: number;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Options for generating a quick preview of audio waveform.
|
|
137
|
-
* This is optimized for UI rendering with a specified number of points.
|
|
138
|
-
*/
|
|
139
|
-
export interface PreviewOptions extends AudioRangeOptions {
|
|
140
|
-
/** URI of the audio file to analyze */
|
|
141
|
-
fileUri: string;
|
|
142
|
-
/**
|
|
143
|
-
* Total number of points to generate for the preview.
|
|
144
|
-
* @default 100
|
|
145
|
-
*/
|
|
146
|
-
numberOfPoints?: number;
|
|
147
|
-
/**
|
|
148
|
-
* Optional logger for debugging.
|
|
149
|
-
*/
|
|
150
|
-
logger?: ConsoleLike;
|
|
151
|
-
/**
|
|
152
|
-
* Optional configuration for decoding the audio file.
|
|
153
|
-
* Defaults to:
|
|
154
|
-
* - targetSampleRate: undefined (keep original)
|
|
155
|
-
* - targetChannels: undefined (keep original)
|
|
156
|
-
* - targetBitDepth: 16
|
|
157
|
-
* - normalizeAudio: false
|
|
158
|
-
*/
|
|
159
|
-
decodingOptions?: DecodingConfig;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Options for mel-spectrogram extraction
|
|
163
|
-
*
|
|
164
|
-
* @experimental This feature is experimental and currently only available on Android.
|
|
165
|
-
* The API may change in future versions.
|
|
166
|
-
*/
|
|
167
|
-
export interface ExtractMelSpectrogramOptions {
|
|
168
|
-
fileUri?: string;
|
|
169
|
-
arrayBuffer?: ArrayBuffer;
|
|
170
|
-
windowSizeMs: number;
|
|
171
|
-
hopLengthMs: number;
|
|
172
|
-
nMels: number;
|
|
173
|
-
fMin?: number;
|
|
174
|
-
fMax?: number;
|
|
175
|
-
windowType?: 'hann' | 'hamming';
|
|
176
|
-
normalize?: boolean;
|
|
177
|
-
logScale?: boolean;
|
|
178
|
-
decodingOptions?: DecodingConfig;
|
|
179
|
-
startTimeMs?: number;
|
|
180
|
-
endTimeMs?: number;
|
|
181
|
-
logger?: ConsoleLike;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Return type for mel spectrogram extraction
|
|
185
|
-
*
|
|
186
|
-
* @experimental This feature is experimental and currently only available on Android.
|
|
187
|
-
* The API may change in future versions.
|
|
188
|
-
*/
|
|
189
|
-
export interface MelSpectrogram {
|
|
190
|
-
spectrogram: number[][];
|
|
191
|
-
sampleRate: number;
|
|
192
|
-
nMels: number;
|
|
193
|
-
timeSteps: number;
|
|
194
|
-
durationMs: number;
|
|
195
|
-
}
|
|
196
|
-
//# sourceMappingURL=AudioAnalysis.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AudioAnalysis.types.d.ts","sourceRoot":"","sources":["../../../src/AudioAnalysis/AudioAnalysis.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module provides functions for extracting and analyzing audio data.
|
|
3
|
-
* - `extractAudioAnalysis`: For detailed analysis with customizable ranges and decoding options.
|
|
4
|
-
* - `extractWavAudioAnalysis`: For analyzing WAV files without decoding, preserving original PCM values.
|
|
5
|
-
* - `extractPreview`: For generating quick previews of audio waveforms, optimized for UI rendering.
|
|
6
|
-
*/
|
|
7
|
-
import { ConsoleLike } from '../ExpoAudioStream.types';
|
|
8
|
-
import { AudioAnalysis, AudioFeaturesOptions, DecodingConfig } from './AudioAnalysis.types';
|
|
9
|
-
import { WavFileInfo } from '../utils/getWavFileInfo';
|
|
10
|
-
export interface ExtractWavAudioAnalysisProps {
|
|
11
|
-
fileUri?: string;
|
|
12
|
-
wavMetadata?: WavFileInfo;
|
|
13
|
-
arrayBuffer?: ArrayBuffer;
|
|
14
|
-
bitDepth?: number;
|
|
15
|
-
durationMs?: number;
|
|
16
|
-
sampleRate?: number;
|
|
17
|
-
numberOfChannels?: number;
|
|
18
|
-
position?: number;
|
|
19
|
-
length?: number;
|
|
20
|
-
segmentDurationMs?: number;
|
|
21
|
-
features?: AudioFeaturesOptions;
|
|
22
|
-
featuresExtratorUrl?: string;
|
|
23
|
-
logger?: ConsoleLike;
|
|
24
|
-
decodingOptions?: DecodingConfig;
|
|
25
|
-
}
|
|
26
|
-
interface BaseExtractOptions {
|
|
27
|
-
fileUri?: string;
|
|
28
|
-
arrayBuffer?: ArrayBuffer;
|
|
29
|
-
/**
|
|
30
|
-
* Duration of each analysis segment in milliseconds. Defaults to 100ms if not specified.
|
|
31
|
-
*/
|
|
32
|
-
segmentDurationMs?: number;
|
|
33
|
-
features?: AudioFeaturesOptions;
|
|
34
|
-
decodingOptions?: DecodingConfig;
|
|
35
|
-
logger?: ConsoleLike;
|
|
36
|
-
}
|
|
37
|
-
interface TimeRangeOptions extends BaseExtractOptions {
|
|
38
|
-
startTimeMs?: number;
|
|
39
|
-
endTimeMs?: number;
|
|
40
|
-
position?: never;
|
|
41
|
-
length?: never;
|
|
42
|
-
}
|
|
43
|
-
interface ByteRangeOptions extends BaseExtractOptions {
|
|
44
|
-
position?: number;
|
|
45
|
-
length?: number;
|
|
46
|
-
startTimeMs?: never;
|
|
47
|
-
endTimeMs?: never;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Options for extracting audio analysis.
|
|
51
|
-
* - For time-based analysis, provide `startTimeMs` and `endTimeMs`.
|
|
52
|
-
* - For byte-based analysis, provide `position` and `length`.
|
|
53
|
-
* - Do not mix time and byte ranges.
|
|
54
|
-
*/
|
|
55
|
-
export type ExtractAudioAnalysisProps = TimeRangeOptions | ByteRangeOptions;
|
|
56
|
-
/**
|
|
57
|
-
* Extracts detailed audio analysis from the specified audio file or buffer.
|
|
58
|
-
* Supports either time-based or byte-based ranges for flexibility in analysis.
|
|
59
|
-
*
|
|
60
|
-
* @param props - The options for extraction, including file URI, ranges, and decoding settings.
|
|
61
|
-
* @returns A promise that resolves to the audio analysis data.
|
|
62
|
-
* @throws {Error} If both time and byte ranges are provided or if required parameters are missing.
|
|
63
|
-
*/
|
|
64
|
-
export declare function extractAudioAnalysis(props: ExtractAudioAnalysisProps): Promise<AudioAnalysis>;
|
|
65
|
-
/**
|
|
66
|
-
* Analyzes WAV files without decoding, preserving original PCM values.
|
|
67
|
-
* Use this function when you need to ensure the analysis matches other software by avoiding any transformations.
|
|
68
|
-
*
|
|
69
|
-
* @param props - The options for WAV analysis, including file URI and range.
|
|
70
|
-
* @returns A promise that resolves to the audio analysis data.
|
|
71
|
-
*/
|
|
72
|
-
export declare const extractRawWavAnalysis: ({ fileUri, segmentDurationMs, arrayBuffer, bitDepth, durationMs, sampleRate, numberOfChannels, features, logger, position, length, }: ExtractWavAudioAnalysisProps) => Promise<AudioAnalysis>;
|
|
73
|
-
export {};
|
|
74
|
-
//# sourceMappingURL=extractAudioAnalysis.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractAudioAnalysis.d.ts","sourceRoot":"","sources":["../../../src/AudioAnalysis/extractAudioAnalysis.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAGtD,OAAO,EACH,aAAa,EACb,oBAAoB,EAEpB,cAAc,EACjB,MAAM,uBAAuB,CAAA;AAK9B,OAAO,EAAkB,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAerE,MAAM,WAAW,4BAA4B;IACzC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,oBAAoB,CAAA;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,eAAe,CAAC,EAAE,cAAc,CAAA;CACnC;AAGD,UAAU,kBAAkB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,oBAAoB,CAAA;IAC/B,eAAe,CAAC,EAAE,cAAc,CAAA;IAChC,MAAM,CAAC,EAAE,WAAW,CAAA;CACvB;AAGD,UAAU,gBAAiB,SAAQ,kBAAkB;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAA;CACjB;AAGD,UAAU,gBAAiB,SAAQ,kBAAkB;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,SAAS,CAAC,EAAE,KAAK,CAAA;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,GAAG,gBAAgB,CAAA;AAE3E;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACtC,KAAK,EAAE,yBAAyB,GACjC,OAAO,CAAC,aAAa,CAAC,CA6HxB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAU,sIAYzC,4BAA4B,KAAG,OAAO,CAAC,aAAa,CAkGtD,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractAudioData.d.ts","sourceRoot":"","sources":["../../../src/AudioAnalysis/extractAudioData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAKlE,eAAO,MAAM,gBAAgB,GAAU,OAAO,uBAAuB,iBAWpE,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @experimental This feature is experimental and currently only available on Android.
|
|
3
|
-
* The API may change in future versions. The web implementation is a placeholder.
|
|
4
|
-
*/
|
|
5
|
-
import { ExtractMelSpectrogramOptions, MelSpectrogram } from './AudioAnalysis.types';
|
|
6
|
-
/**
|
|
7
|
-
* Extracts a mel spectrogram from audio data
|
|
8
|
-
*
|
|
9
|
-
* @experimental This feature is experimental and currently only available on Android.
|
|
10
|
-
* The iOS implementation will throw an "UNSUPPORTED_PLATFORM" error.
|
|
11
|
-
* The web implementation is a placeholder that returns dummy data.
|
|
12
|
-
*/
|
|
13
|
-
export declare function extractMelSpectrogram(options: ExtractMelSpectrogramOptions): Promise<MelSpectrogram>;
|
|
14
|
-
//# sourceMappingURL=extractMelSpectrogram.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractMelSpectrogram.d.ts","sourceRoot":"","sources":["../../../src/AudioAnalysis/extractMelSpectrogram.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACH,4BAA4B,EAC5B,cAAc,EACjB,MAAM,uBAAuB,CAAA;AAO9B;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACvC,OAAO,EAAE,4BAA4B,GACtC,OAAO,CAAC,cAAc,CAAC,CAuFzB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PreviewOptions, AudioAnalysis } from './AudioAnalysis.types';
|
|
2
|
-
/**
|
|
3
|
-
* Generates a simplified preview of the audio waveform for quick visualization.
|
|
4
|
-
* Ideal for UI rendering with a specified number of points.
|
|
5
|
-
*
|
|
6
|
-
* @param options - The options for the preview, including file URI and time range.
|
|
7
|
-
* @returns A promise that resolves to the audio preview data.
|
|
8
|
-
*/
|
|
9
|
-
export declare function extractPreview({ fileUri, numberOfPoints, startTimeMs, endTimeMs, // First 30 seconds
|
|
10
|
-
decodingOptions, logger, }: PreviewOptions): Promise<AudioAnalysis>;
|
|
11
|
-
//# sourceMappingURL=extractPreview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractPreview.d.ts","sourceRoot":"","sources":["../../../src/AudioAnalysis/extractPreview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAGrE;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,EACjC,OAAO,EACP,cAAoB,EACpB,WAAe,EACf,SAAiB,EAAE,mBAAmB;AACtC,eAAe,EACf,MAAM,GACT,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAgBzC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface ExtractWaveformProps {
|
|
2
|
-
fileUri: string;
|
|
3
|
-
numberOfSamples: number;
|
|
4
|
-
offset?: number;
|
|
5
|
-
length?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const extractWaveform: ({ fileUri, numberOfSamples, offset, length, }: ExtractWaveformProps) => Promise<unknown>;
|
|
8
|
-
//# sourceMappingURL=extractWaveform.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractWaveform.d.ts","sourceRoot":"","sources":["../../../src/AudioAnalysis/extractWaveform.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB;AACD,eAAO,MAAM,eAAe,GAAU,+CAKnC,oBAAoB,KAAG,OAAO,CAAC,OAAO,CAQxC,CAAA"}
|