@siteed/expo-audio-stream 1.2.0 → 1.2.2
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/.publisher/hooks/index.ts +21 -0
- package/CHANGELOG.md +1 -1
- package/android/build/.transforms/86d1c68f279e188fca02f34f0eac8826/results.bin +1 -0
- package/android/build/.transforms/86d1c68f279e188fca02f34f0eac8826/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/871e87a512fbb418f6a6523c40225bac/results.bin +1 -0
- package/android/build/.transforms/871e87a512fbb418f6a6523c40225bac/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/results.bin +1 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioAnalysisData$AmplitudeRange.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioAnalysisData$SpeakerChange.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioAnalysisData.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioDataEncoder.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioFileHandler.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioFormatInfo.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioFormatUtils.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioNotificationManager$Companion.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioNotificationManager.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor$AudioData.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor$Companion.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor$extractMFCC$powerSpectrum$2.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioProcessor.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioRecorderManager$Companion.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioRecorderManager.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioRecordingService$Companion.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioRecordingService$notificationManager$2.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/AudioRecordingService.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/BuildConfig.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/Constants.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/DataPoint.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/EventSender.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$1.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$10.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$11.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$12.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$13.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$14.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$15.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$16.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$17.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$18.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$19.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$2.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$20.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$21.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$22.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$23.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$24.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$3.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$4.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$5.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$6.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$7.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$8.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunction$9.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunctionWithPromise$1.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunctionWithPromise$2.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunctionWithPromise$3.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$AsyncFunctionWithPromise$4.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$FunctionWithoutArgs$1.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule$definition$lambda$16$$inlined$FunctionWithoutArgs$2.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/ExpoAudioStreamModule.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/FFT.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/Features.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/NotificationAction.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/NotificationConfig$Companion.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/NotificationConfig.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/PermissionUtils.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/RecordingActionReceiver$Companion.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/RecordingActionReceiver$handleRecordingAction$notificationPromise$1.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/RecordingActionReceiver.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/RecordingConfig$Companion.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/RecordingConfig.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/RecordingConfigKt.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/WaveformConfig.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/WaveformRenderer$RenderConfig$Companion.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/WaveformRenderer$RenderConfig.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/WaveformRenderer$Style.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/WaveformRenderer$WhenMappings.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/debug_dex/net/siteed/audiostream/WaveformRenderer.dex +0 -0
- package/android/build/.transforms/99bb16aff51bfafd6c73c1b96e3e0dcf/transformed/debug/desugar_graph.bin +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +4 -5
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +1 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/build/workers/InlineFeaturesExtractor.web.d.ts +1 -1
- package/build/workers/InlineFeaturesExtractor.web.d.ts.map +1 -1
- package/build/workers/InlineFeaturesExtractor.web.js +0 -2
- package/build/workers/InlineFeaturesExtractor.web.js.map +1 -1
- package/package.json +3 -1
- package/plugin/build/index.js +0 -10
- package/plugin/src/index.ts +0 -11
- package/publish.sh +2 -1
- package/publisher.config.ts +39 -0
- package/src/workers/InlineFeaturesExtractor.web.tsx +0 -2
- package/.cursorrules +0 -112
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PackageContext } from '@siteed/publisher';
|
|
2
|
+
import { exec } from '@siteed/publisher';
|
|
3
|
+
|
|
4
|
+
export async function preRelease(context: PackageContext): Promise<void> {
|
|
5
|
+
// Run tests
|
|
6
|
+
await exec('{{packageManager}} test', { cwd: context.path });
|
|
7
|
+
|
|
8
|
+
// Run type checking
|
|
9
|
+
await exec('{{packageManager}} typecheck', { cwd: context.path });
|
|
10
|
+
|
|
11
|
+
// Build the package
|
|
12
|
+
await exec('{{packageManager}} build', { cwd: context.path });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function postRelease(context: PackageContext): Promise<void> {
|
|
16
|
+
// Clean up build artifacts
|
|
17
|
+
await exec('{{packageManager}} clean', { cwd: context.path });
|
|
18
|
+
|
|
19
|
+
// Run any post-release notifications or integrations
|
|
20
|
+
console.log(`Successfully released ${context.name}@${context.newVersion}`);
|
|
21
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
16
16
|
- Android: Configurable notification actions, colors, and priorities
|
|
17
17
|
- iOS: Integration with media player
|
|
18
18
|
|
|
19
|
-
## [1.1.17] - 2024-10-
|
|
19
|
+
## [1.1.17] - 2024-10-21
|
|
20
20
|
### Added
|
|
21
21
|
- Support bluetooth headset on ios
|
|
22
22
|
- Fixes: android not reading custom interval audio update
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
o/classes
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
o/classes
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
o/debug
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#
|
|
2
|
-
net.siteed.audiostream.siteed-expo-audio-stream-main-6\:/drawable/ic_default_action_icon.xml=/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/intermediates/packaged_res/debug/drawable/ic_default_action_icon.xml
|
|
1
|
+
#Mon Oct 28 08:59:29 HKT 2024
|
|
3
2
|
net.siteed.audiostream.siteed-expo-audio-stream-main-6\:/drawable/ic_microphone.xml=/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/intermediates/packaged_res/debug/drawable/ic_microphone.xml
|
|
3
|
+
net.siteed.audiostream.siteed-expo-audio-stream-main-6\:/layout/notification_recording.xml=/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/intermediates/packaged_res/debug/layout/notification_recording.xml
|
|
4
|
+
net.siteed.audiostream.siteed-expo-audio-stream-main-6\:/drawable/ic_stop.xml=/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/intermediates/packaged_res/debug/drawable/ic_stop.xml
|
|
4
5
|
net.siteed.audiostream.siteed-expo-audio-stream-main-6\:/drawable/ic_pause.xml=/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/intermediates/packaged_res/debug/drawable/ic_pause.xml
|
|
5
6
|
net.siteed.audiostream.siteed-expo-audio-stream-main-6\:/drawable/ic_play.xml=/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/intermediates/packaged_res/debug/drawable/ic_play.xml
|
|
6
|
-
net.siteed.audiostream.siteed-expo-audio-stream-main-6\:/drawable/
|
|
7
|
-
net.siteed.audiostream.siteed-expo-audio-stream-main-6\:/drawable/ic_stop.xml=/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/intermediates/packaged_res/debug/drawable/ic_stop.xml
|
|
8
|
-
net.siteed.audiostream.siteed-expo-audio-stream-main-6\:/layout/notification_recording.xml=/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/intermediates/packaged_res/debug/layout/notification_recording.xml
|
|
7
|
+
net.siteed.audiostream.siteed-expo-audio-stream-main-6\:/drawable/ic_default_action_icon.xml=/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/intermediates/packaged_res/debug/drawable/ic_default_action_icon.xml
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res"><file name="ic_default_action_icon" path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res/drawable/ic_default_action_icon.xml" qualifiers="" type="drawable"/><file name="ic_microphone" path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res/drawable/ic_microphone.xml" qualifiers="" type="drawable"/><file name="ic_pause" path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res/drawable/ic_pause.xml" qualifiers="" type="drawable"/><file name="
|
|
2
|
+
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res"><file name="ic_default_action_icon" path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res/drawable/ic_default_action_icon.xml" qualifiers="" type="drawable"/><file name="ic_microphone" path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res/drawable/ic_microphone.xml" qualifiers="" type="drawable"/><file name="ic_pause" path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res/drawable/ic_pause.xml" qualifiers="" type="drawable"/><file name="ic_play" path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res/drawable/ic_play.xml" qualifiers="" type="drawable"/><file name="ic_stop" path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res/drawable/ic_stop.xml" qualifiers="" type="drawable"/><file name="notification_recording" path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/res/layout/notification_recording.xml" qualifiers="" type="layout"/></source></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated" generated-set="generated$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/generated/res/resValues/debug"/></dataSet><mergedItems/></merger>
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const InlineFeaturesExtractor = "\n// Unique ID counter\nlet uniqueIdCounter = 0\n\nself.onmessage = function (event) {\n const {\n channelData, // this is only the newly recorded data when live recording.\n sampleRate,\n pointsPerSecond,\n algorithm,\n bitDepth,\n fullAudioDurationMs,\n numberOfChannels,\n features: _features,\n } = event.data\n\n console.log('[AudioFeaturesExtractor] Worker received message', event.data)\n const features = _features || {}\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 const extractHNR = (segmentData) => {\n const frameSize = segmentData.length\n const autocorrelation = new Float32Array(frameSize)\n\n // Compute the autocorrelation of the segment data\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 (excluding the zero lag)\n const maxAutocorrelation = Math.max(...autocorrelation.subarray(1))\n\n // Compute the HNR\n return autocorrelation[0] !== 0\n ? 10 *\n Math.log10(\n maxAutocorrelation /\n (autocorrelation[0] - maxAutocorrelation)\n )\n : 0\n }\n\n const extractWaveform = (\n channelData, // Float32Array\n sampleRate, // number\n pointsPerSecond, // number\n algorithm // string\n ) => {\n const totalSamples = channelData.length\n const segmentDuration = totalSamples / sampleRate\n const totalPoints = Math.max(\n Math.ceil(segmentDuration * pointsPerSecond),\n 1\n )\n const pointInterval = Math.ceil(totalSamples / totalPoints)\n const dataPoints = []\n let minAmplitude = Infinity\n let maxAmplitude = -Infinity\n let silenceStart = null\n let lastSpeechEnd = -Infinity\n let isSpeech = false\n\n const expectedPoints = segmentDuration * pointsPerSecond\n const samplesPerPoint = Math.ceil(channelData.length / expectedPoints)\n\n for (let i = 0; i < expectedPoints; i++) {\n const start = i * samplesPerPoint\n const end = Math.min(start + samplesPerPoint, totalSamples)\n\n let sumSquares = 0\n let zeroCrossings = 0\n let prevValue = channelData[start]\n let localMinAmplitude = Infinity\n let localMaxAmplitude = -Infinity\n let hasNonZeroValue = false\n\n // compute values for the segment\n for (let j = start; j < end; j++) {\n const value = channelData[j]\n sumSquares += value * value\n if (j > start && value * prevValue < 0) {\n zeroCrossings++\n }\n prevValue = value\n\n // We need to keep absolute value otherwise we cannot visualize properly\n const absValue = Math.abs(value)\n localMinAmplitude = Math.min(localMinAmplitude, absValue)\n localMaxAmplitude = Math.max(localMaxAmplitude, absValue)\n\n if (value !== 0) {\n hasNonZeroValue = true\n }\n }\n\n // Post-processing checks\n if (!hasNonZeroValue) {\n // All values are zero\n localMinAmplitude = 0\n localMaxAmplitude = 0\n }\n\n const rms = Math.sqrt(sumSquares / (end - start))\n minAmplitude = Math.min(minAmplitude, localMinAmplitude)\n maxAmplitude = Math.max(maxAmplitude, localMaxAmplitude)\n\n const energy = sumSquares\n const zcr = zeroCrossings / (end - start)\n\n const silent = rms < SILENCE_THRESHOLD\n const dB = 20 * Math.log10(rms)\n\n if (silent) {\n if (silenceStart === null) {\n silenceStart = start\n } else if (start - silenceStart > MIN_SILENCE_DURATION) {\n // Silence detected for longer than the threshold, set amplitude to 0\n localMaxAmplitude = 0\n localMinAmplitude = 0\n isSpeech = false\n }\n } else {\n silenceStart = null\n if (\n !isSpeech &&\n start - lastSpeechEnd < SPEECH_INERTIA_DURATION\n ) {\n isSpeech = true\n }\n lastSpeechEnd = end\n }\n\n const activeSpeech =\n (rms > RMS_THRESHOLD && zcr > ZCR_THRESHOLD) ||\n (isSpeech && start - lastSpeechEnd < SPEECH_INERTIA_DURATION)\n\n if (activeSpeech) {\n isSpeech = true\n lastSpeechEnd = end\n } else {\n isSpeech = false\n }\n\n const bytesPerSample = bitDepth / 8\n const startPosition = start * bytesPerSample * numberOfChannels // Calculate start position in bytes\n const endPosition = end * bytesPerSample * numberOfChannels // Calculate end position in bytes\n\n // Compute features\n const segmentData = channelData.slice(start, end)\n const mfcc = features.mfcc\n ? extractMFCC(segmentData, sampleRate)\n : []\n const spectralCentroid = features.spectralCentroid\n ? extractSpectralCentroid(segmentData, sampleRate)\n : 0\n const spectralFlatness = features.spectralFlatness\n ? extractSpectralFlatness(segmentData)\n : 0\n const spectralRollOff = features.spectralRollOff\n ? extractSpectralRollOff(segmentData, sampleRate)\n : 0\n const spectralBandwidth = features.spectralBandwidth\n ? extractSpectralBandwidth(segmentData, sampleRate)\n : 0\n const chromagram = features.chromagram\n ? extractChromagram(segmentData, sampleRate)\n : []\n const hnr = features.hnr ? extractHNR(segmentData) : 0\n\n const peakAmp = Math.max(Math.abs(localMaxAmplitude), Math.abs(localMinAmplitude))\n const newData = {\n id: uniqueIdCounter++, // Assign unique ID and increment the counter\n amplitude: algorithm === 'peak' ? peakAmp : rms,\n activeSpeech,\n dB,\n silent,\n features: {\n energy,\n rms,\n minAmplitude: localMinAmplitude,\n maxAmplitude: localMaxAmplitude,\n zcr,\n mfcc: [], // Placeholder for MFCC features\n spectralCentroid, // Computed spectral centroid\n spectralFlatness, // Computed spectral flatness\n spectralRollOff, // Computed spectral roll-off\n spectralBandwidth, // Computed spectral bandwidth\n chromagram, // Computed chromagram\n hnr, // Computed HNR\n },\n startTime: start / sampleRate,\n endTime: end / sampleRate,\n startPosition,\n endPosition,\n samples: end - start,\n speaker: 0, // Assuming speaker detection is to be handled later\n }\n\n dataPoints.push(newData)\n }\n\n return {\n pointsPerSecond,\n amplitudeAlgorithm: algorithm,\n durationMs: fullAudioDurationMs,\n bitDepth,\n samples: totalSamples,\n numberOfChannels,\n sampleRate,\n dataPoints,\n amplitudeRange: {\n min: minAmplitude,\n max: maxAmplitude,\n },\n speakerChanges: [], // Placeholder for future speaker detection logic\n }\n }\n\n try {\n const result = extractWaveform(\n channelData,\n sampleRate,\n pointsPerSecond,\n algorithm\n )\n self.postMessage({\n command: 'features',\n result,\n })\n } catch (error) {\n console.error('[AudioFeaturesExtractor] Error in processing', error)\n self.postMessage({ error: error.message })\n } finally {\n // Do not close the worker so it can be re-used for subsequent messages\n // self.close();\n }\n}\n";
|
|
1
|
+
export declare const InlineFeaturesExtractor = "\n// Unique ID counter\nlet uniqueIdCounter = 0\n\nself.onmessage = function (event) {\n const {\n channelData, // this is only the newly recorded data when live recording.\n sampleRate,\n pointsPerSecond,\n algorithm,\n bitDepth,\n fullAudioDurationMs,\n numberOfChannels,\n features: _features,\n } = event.data\n const features = _features || {}\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 const extractHNR = (segmentData) => {\n const frameSize = segmentData.length\n const autocorrelation = new Float32Array(frameSize)\n\n // Compute the autocorrelation of the segment data\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 (excluding the zero lag)\n const maxAutocorrelation = Math.max(...autocorrelation.subarray(1))\n\n // Compute the HNR\n return autocorrelation[0] !== 0\n ? 10 *\n Math.log10(\n maxAutocorrelation /\n (autocorrelation[0] - maxAutocorrelation)\n )\n : 0\n }\n\n const extractWaveform = (\n channelData, // Float32Array\n sampleRate, // number\n pointsPerSecond, // number\n algorithm // string\n ) => {\n const totalSamples = channelData.length\n const segmentDuration = totalSamples / sampleRate\n const totalPoints = Math.max(\n Math.ceil(segmentDuration * pointsPerSecond),\n 1\n )\n const pointInterval = Math.ceil(totalSamples / totalPoints)\n const dataPoints = []\n let minAmplitude = Infinity\n let maxAmplitude = -Infinity\n let silenceStart = null\n let lastSpeechEnd = -Infinity\n let isSpeech = false\n\n const expectedPoints = segmentDuration * pointsPerSecond\n const samplesPerPoint = Math.ceil(channelData.length / expectedPoints)\n\n for (let i = 0; i < expectedPoints; i++) {\n const start = i * samplesPerPoint\n const end = Math.min(start + samplesPerPoint, totalSamples)\n\n let sumSquares = 0\n let zeroCrossings = 0\n let prevValue = channelData[start]\n let localMinAmplitude = Infinity\n let localMaxAmplitude = -Infinity\n let hasNonZeroValue = false\n\n // compute values for the segment\n for (let j = start; j < end; j++) {\n const value = channelData[j]\n sumSquares += value * value\n if (j > start && value * prevValue < 0) {\n zeroCrossings++\n }\n prevValue = value\n\n // We need to keep absolute value otherwise we cannot visualize properly\n const absValue = Math.abs(value)\n localMinAmplitude = Math.min(localMinAmplitude, absValue)\n localMaxAmplitude = Math.max(localMaxAmplitude, absValue)\n\n if (value !== 0) {\n hasNonZeroValue = true\n }\n }\n\n // Post-processing checks\n if (!hasNonZeroValue) {\n // All values are zero\n localMinAmplitude = 0\n localMaxAmplitude = 0\n }\n\n const rms = Math.sqrt(sumSquares / (end - start))\n minAmplitude = Math.min(minAmplitude, localMinAmplitude)\n maxAmplitude = Math.max(maxAmplitude, localMaxAmplitude)\n\n const energy = sumSquares\n const zcr = zeroCrossings / (end - start)\n\n const silent = rms < SILENCE_THRESHOLD\n const dB = 20 * Math.log10(rms)\n\n if (silent) {\n if (silenceStart === null) {\n silenceStart = start\n } else if (start - silenceStart > MIN_SILENCE_DURATION) {\n // Silence detected for longer than the threshold, set amplitude to 0\n localMaxAmplitude = 0\n localMinAmplitude = 0\n isSpeech = false\n }\n } else {\n silenceStart = null\n if (\n !isSpeech &&\n start - lastSpeechEnd < SPEECH_INERTIA_DURATION\n ) {\n isSpeech = true\n }\n lastSpeechEnd = end\n }\n\n const activeSpeech =\n (rms > RMS_THRESHOLD && zcr > ZCR_THRESHOLD) ||\n (isSpeech && start - lastSpeechEnd < SPEECH_INERTIA_DURATION)\n\n if (activeSpeech) {\n isSpeech = true\n lastSpeechEnd = end\n } else {\n isSpeech = false\n }\n\n const bytesPerSample = bitDepth / 8\n const startPosition = start * bytesPerSample * numberOfChannels // Calculate start position in bytes\n const endPosition = end * bytesPerSample * numberOfChannels // Calculate end position in bytes\n\n // Compute features\n const segmentData = channelData.slice(start, end)\n const mfcc = features.mfcc\n ? extractMFCC(segmentData, sampleRate)\n : []\n const spectralCentroid = features.spectralCentroid\n ? extractSpectralCentroid(segmentData, sampleRate)\n : 0\n const spectralFlatness = features.spectralFlatness\n ? extractSpectralFlatness(segmentData)\n : 0\n const spectralRollOff = features.spectralRollOff\n ? extractSpectralRollOff(segmentData, sampleRate)\n : 0\n const spectralBandwidth = features.spectralBandwidth\n ? extractSpectralBandwidth(segmentData, sampleRate)\n : 0\n const chromagram = features.chromagram\n ? extractChromagram(segmentData, sampleRate)\n : []\n const hnr = features.hnr ? extractHNR(segmentData) : 0\n\n const peakAmp = Math.max(Math.abs(localMaxAmplitude), Math.abs(localMinAmplitude))\n const newData = {\n id: uniqueIdCounter++, // Assign unique ID and increment the counter\n amplitude: algorithm === 'peak' ? peakAmp : rms,\n activeSpeech,\n dB,\n silent,\n features: {\n energy,\n rms,\n minAmplitude: localMinAmplitude,\n maxAmplitude: localMaxAmplitude,\n zcr,\n mfcc: [], // Placeholder for MFCC features\n spectralCentroid, // Computed spectral centroid\n spectralFlatness, // Computed spectral flatness\n spectralRollOff, // Computed spectral roll-off\n spectralBandwidth, // Computed spectral bandwidth\n chromagram, // Computed chromagram\n hnr, // Computed HNR\n },\n startTime: start / sampleRate,\n endTime: end / sampleRate,\n startPosition,\n endPosition,\n samples: end - start,\n speaker: 0, // Assuming speaker detection is to be handled later\n }\n\n dataPoints.push(newData)\n }\n\n return {\n pointsPerSecond,\n amplitudeAlgorithm: algorithm,\n durationMs: fullAudioDurationMs,\n bitDepth,\n samples: totalSamples,\n numberOfChannels,\n sampleRate,\n dataPoints,\n amplitudeRange: {\n min: minAmplitude,\n max: maxAmplitude,\n },\n speakerChanges: [], // Placeholder for future speaker detection logic\n }\n }\n\n try {\n const result = extractWaveform(\n channelData,\n sampleRate,\n pointsPerSecond,\n algorithm\n )\n self.postMessage({\n command: 'features',\n result,\n })\n } catch (error) {\n console.error('[AudioFeaturesExtractor] Error in processing', error)\n self.postMessage({ error: error.message })\n } finally {\n // Do not close the worker so it can be re-used for subsequent messages\n // self.close();\n }\n}\n";
|
|
2
2
|
//# sourceMappingURL=InlineFeaturesExtractor.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineFeaturesExtractor.web.d.ts","sourceRoot":"","sources":["../../src/workers/InlineFeaturesExtractor.web.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"InlineFeaturesExtractor.web.d.ts","sourceRoot":"","sources":["../../src/workers/InlineFeaturesExtractor.web.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,ytWAqTnC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineFeaturesExtractor.web.js","sourceRoot":"","sources":["../../src/workers/InlineFeaturesExtractor.web.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuTtC,CAAA","sourcesContent":["export const InlineFeaturesExtractor = `\n// Unique ID counter\nlet uniqueIdCounter = 0\n\nself.onmessage = function (event) {\n const {\n channelData, // this is only the newly recorded data when live recording.\n sampleRate,\n pointsPerSecond,\n algorithm,\n bitDepth,\n fullAudioDurationMs,\n numberOfChannels,\n features: _features,\n } = event.data\n\n console.log('[AudioFeaturesExtractor] Worker received message', event.data)\n const features = _features || {}\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 const extractHNR = (segmentData) => {\n const frameSize = segmentData.length\n const autocorrelation = new Float32Array(frameSize)\n\n // Compute the autocorrelation of the segment data\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 (excluding the zero lag)\n const maxAutocorrelation = Math.max(...autocorrelation.subarray(1))\n\n // Compute the HNR\n return autocorrelation[0] !== 0\n ? 10 *\n Math.log10(\n maxAutocorrelation /\n (autocorrelation[0] - maxAutocorrelation)\n )\n : 0\n }\n\n const extractWaveform = (\n channelData, // Float32Array\n sampleRate, // number\n pointsPerSecond, // number\n algorithm // string\n ) => {\n const totalSamples = channelData.length\n const segmentDuration = totalSamples / sampleRate\n const totalPoints = Math.max(\n Math.ceil(segmentDuration * pointsPerSecond),\n 1\n )\n const pointInterval = Math.ceil(totalSamples / totalPoints)\n const dataPoints = []\n let minAmplitude = Infinity\n let maxAmplitude = -Infinity\n let silenceStart = null\n let lastSpeechEnd = -Infinity\n let isSpeech = false\n\n const expectedPoints = segmentDuration * pointsPerSecond\n const samplesPerPoint = Math.ceil(channelData.length / expectedPoints)\n\n for (let i = 0; i < expectedPoints; i++) {\n const start = i * samplesPerPoint\n const end = Math.min(start + samplesPerPoint, totalSamples)\n\n let sumSquares = 0\n let zeroCrossings = 0\n let prevValue = channelData[start]\n let localMinAmplitude = Infinity\n let localMaxAmplitude = -Infinity\n let hasNonZeroValue = false\n\n // compute values for the segment\n for (let j = start; j < end; j++) {\n const value = channelData[j]\n sumSquares += value * value\n if (j > start && value * prevValue < 0) {\n zeroCrossings++\n }\n prevValue = value\n\n // We need to keep absolute value otherwise we cannot visualize properly\n const absValue = Math.abs(value)\n localMinAmplitude = Math.min(localMinAmplitude, absValue)\n localMaxAmplitude = Math.max(localMaxAmplitude, absValue)\n\n if (value !== 0) {\n hasNonZeroValue = true\n }\n }\n\n // Post-processing checks\n if (!hasNonZeroValue) {\n // All values are zero\n localMinAmplitude = 0\n localMaxAmplitude = 0\n }\n\n const rms = Math.sqrt(sumSquares / (end - start))\n minAmplitude = Math.min(minAmplitude, localMinAmplitude)\n maxAmplitude = Math.max(maxAmplitude, localMaxAmplitude)\n\n const energy = sumSquares\n const zcr = zeroCrossings / (end - start)\n\n const silent = rms < SILENCE_THRESHOLD\n const dB = 20 * Math.log10(rms)\n\n if (silent) {\n if (silenceStart === null) {\n silenceStart = start\n } else if (start - silenceStart > MIN_SILENCE_DURATION) {\n // Silence detected for longer than the threshold, set amplitude to 0\n localMaxAmplitude = 0\n localMinAmplitude = 0\n isSpeech = false\n }\n } else {\n silenceStart = null\n if (\n !isSpeech &&\n start - lastSpeechEnd < SPEECH_INERTIA_DURATION\n ) {\n isSpeech = true\n }\n lastSpeechEnd = end\n }\n\n const activeSpeech =\n (rms > RMS_THRESHOLD && zcr > ZCR_THRESHOLD) ||\n (isSpeech && start - lastSpeechEnd < SPEECH_INERTIA_DURATION)\n\n if (activeSpeech) {\n isSpeech = true\n lastSpeechEnd = end\n } else {\n isSpeech = false\n }\n\n const bytesPerSample = bitDepth / 8\n const startPosition = start * bytesPerSample * numberOfChannels // Calculate start position in bytes\n const endPosition = end * bytesPerSample * numberOfChannels // Calculate end position in bytes\n\n // Compute features\n const segmentData = channelData.slice(start, end)\n const mfcc = features.mfcc\n ? extractMFCC(segmentData, sampleRate)\n : []\n const spectralCentroid = features.spectralCentroid\n ? extractSpectralCentroid(segmentData, sampleRate)\n : 0\n const spectralFlatness = features.spectralFlatness\n ? extractSpectralFlatness(segmentData)\n : 0\n const spectralRollOff = features.spectralRollOff\n ? extractSpectralRollOff(segmentData, sampleRate)\n : 0\n const spectralBandwidth = features.spectralBandwidth\n ? extractSpectralBandwidth(segmentData, sampleRate)\n : 0\n const chromagram = features.chromagram\n ? extractChromagram(segmentData, sampleRate)\n : []\n const hnr = features.hnr ? extractHNR(segmentData) : 0\n\n const peakAmp = Math.max(Math.abs(localMaxAmplitude), Math.abs(localMinAmplitude))\n const newData = {\n id: uniqueIdCounter++, // Assign unique ID and increment the counter\n amplitude: algorithm === 'peak' ? peakAmp : rms,\n activeSpeech,\n dB,\n silent,\n features: {\n energy,\n rms,\n minAmplitude: localMinAmplitude,\n maxAmplitude: localMaxAmplitude,\n zcr,\n mfcc: [], // Placeholder for MFCC features\n spectralCentroid, // Computed spectral centroid\n spectralFlatness, // Computed spectral flatness\n spectralRollOff, // Computed spectral roll-off\n spectralBandwidth, // Computed spectral bandwidth\n chromagram, // Computed chromagram\n hnr, // Computed HNR\n },\n startTime: start / sampleRate,\n endTime: end / sampleRate,\n startPosition,\n endPosition,\n samples: end - start,\n speaker: 0, // Assuming speaker detection is to be handled later\n }\n\n dataPoints.push(newData)\n }\n\n return {\n pointsPerSecond,\n amplitudeAlgorithm: algorithm,\n durationMs: fullAudioDurationMs,\n bitDepth,\n samples: totalSamples,\n numberOfChannels,\n sampleRate,\n dataPoints,\n amplitudeRange: {\n min: minAmplitude,\n max: maxAmplitude,\n },\n speakerChanges: [], // Placeholder for future speaker detection logic\n }\n }\n\n try {\n const result = extractWaveform(\n channelData,\n sampleRate,\n pointsPerSecond,\n algorithm\n )\n self.postMessage({\n command: 'features',\n result,\n })\n } catch (error) {\n console.error('[AudioFeaturesExtractor] Error in processing', error)\n self.postMessage({ error: error.message })\n } finally {\n // Do not close the worker so it can be re-used for subsequent messages\n // self.close();\n }\n}\n`\n"]}
|
|
1
|
+
{"version":3,"file":"InlineFeaturesExtractor.web.js","sourceRoot":"","sources":["../../src/workers/InlineFeaturesExtractor.web.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqTtC,CAAA","sourcesContent":["export const InlineFeaturesExtractor = `\n// Unique ID counter\nlet uniqueIdCounter = 0\n\nself.onmessage = function (event) {\n const {\n channelData, // this is only the newly recorded data when live recording.\n sampleRate,\n pointsPerSecond,\n algorithm,\n bitDepth,\n fullAudioDurationMs,\n numberOfChannels,\n features: _features,\n } = event.data\n const features = _features || {}\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 const extractHNR = (segmentData) => {\n const frameSize = segmentData.length\n const autocorrelation = new Float32Array(frameSize)\n\n // Compute the autocorrelation of the segment data\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 (excluding the zero lag)\n const maxAutocorrelation = Math.max(...autocorrelation.subarray(1))\n\n // Compute the HNR\n return autocorrelation[0] !== 0\n ? 10 *\n Math.log10(\n maxAutocorrelation /\n (autocorrelation[0] - maxAutocorrelation)\n )\n : 0\n }\n\n const extractWaveform = (\n channelData, // Float32Array\n sampleRate, // number\n pointsPerSecond, // number\n algorithm // string\n ) => {\n const totalSamples = channelData.length\n const segmentDuration = totalSamples / sampleRate\n const totalPoints = Math.max(\n Math.ceil(segmentDuration * pointsPerSecond),\n 1\n )\n const pointInterval = Math.ceil(totalSamples / totalPoints)\n const dataPoints = []\n let minAmplitude = Infinity\n let maxAmplitude = -Infinity\n let silenceStart = null\n let lastSpeechEnd = -Infinity\n let isSpeech = false\n\n const expectedPoints = segmentDuration * pointsPerSecond\n const samplesPerPoint = Math.ceil(channelData.length / expectedPoints)\n\n for (let i = 0; i < expectedPoints; i++) {\n const start = i * samplesPerPoint\n const end = Math.min(start + samplesPerPoint, totalSamples)\n\n let sumSquares = 0\n let zeroCrossings = 0\n let prevValue = channelData[start]\n let localMinAmplitude = Infinity\n let localMaxAmplitude = -Infinity\n let hasNonZeroValue = false\n\n // compute values for the segment\n for (let j = start; j < end; j++) {\n const value = channelData[j]\n sumSquares += value * value\n if (j > start && value * prevValue < 0) {\n zeroCrossings++\n }\n prevValue = value\n\n // We need to keep absolute value otherwise we cannot visualize properly\n const absValue = Math.abs(value)\n localMinAmplitude = Math.min(localMinAmplitude, absValue)\n localMaxAmplitude = Math.max(localMaxAmplitude, absValue)\n\n if (value !== 0) {\n hasNonZeroValue = true\n }\n }\n\n // Post-processing checks\n if (!hasNonZeroValue) {\n // All values are zero\n localMinAmplitude = 0\n localMaxAmplitude = 0\n }\n\n const rms = Math.sqrt(sumSquares / (end - start))\n minAmplitude = Math.min(minAmplitude, localMinAmplitude)\n maxAmplitude = Math.max(maxAmplitude, localMaxAmplitude)\n\n const energy = sumSquares\n const zcr = zeroCrossings / (end - start)\n\n const silent = rms < SILENCE_THRESHOLD\n const dB = 20 * Math.log10(rms)\n\n if (silent) {\n if (silenceStart === null) {\n silenceStart = start\n } else if (start - silenceStart > MIN_SILENCE_DURATION) {\n // Silence detected for longer than the threshold, set amplitude to 0\n localMaxAmplitude = 0\n localMinAmplitude = 0\n isSpeech = false\n }\n } else {\n silenceStart = null\n if (\n !isSpeech &&\n start - lastSpeechEnd < SPEECH_INERTIA_DURATION\n ) {\n isSpeech = true\n }\n lastSpeechEnd = end\n }\n\n const activeSpeech =\n (rms > RMS_THRESHOLD && zcr > ZCR_THRESHOLD) ||\n (isSpeech && start - lastSpeechEnd < SPEECH_INERTIA_DURATION)\n\n if (activeSpeech) {\n isSpeech = true\n lastSpeechEnd = end\n } else {\n isSpeech = false\n }\n\n const bytesPerSample = bitDepth / 8\n const startPosition = start * bytesPerSample * numberOfChannels // Calculate start position in bytes\n const endPosition = end * bytesPerSample * numberOfChannels // Calculate end position in bytes\n\n // Compute features\n const segmentData = channelData.slice(start, end)\n const mfcc = features.mfcc\n ? extractMFCC(segmentData, sampleRate)\n : []\n const spectralCentroid = features.spectralCentroid\n ? extractSpectralCentroid(segmentData, sampleRate)\n : 0\n const spectralFlatness = features.spectralFlatness\n ? extractSpectralFlatness(segmentData)\n : 0\n const spectralRollOff = features.spectralRollOff\n ? extractSpectralRollOff(segmentData, sampleRate)\n : 0\n const spectralBandwidth = features.spectralBandwidth\n ? extractSpectralBandwidth(segmentData, sampleRate)\n : 0\n const chromagram = features.chromagram\n ? extractChromagram(segmentData, sampleRate)\n : []\n const hnr = features.hnr ? extractHNR(segmentData) : 0\n\n const peakAmp = Math.max(Math.abs(localMaxAmplitude), Math.abs(localMinAmplitude))\n const newData = {\n id: uniqueIdCounter++, // Assign unique ID and increment the counter\n amplitude: algorithm === 'peak' ? peakAmp : rms,\n activeSpeech,\n dB,\n silent,\n features: {\n energy,\n rms,\n minAmplitude: localMinAmplitude,\n maxAmplitude: localMaxAmplitude,\n zcr,\n mfcc: [], // Placeholder for MFCC features\n spectralCentroid, // Computed spectral centroid\n spectralFlatness, // Computed spectral flatness\n spectralRollOff, // Computed spectral roll-off\n spectralBandwidth, // Computed spectral bandwidth\n chromagram, // Computed chromagram\n hnr, // Computed HNR\n },\n startTime: start / sampleRate,\n endTime: end / sampleRate,\n startPosition,\n endPosition,\n samples: end - start,\n speaker: 0, // Assuming speaker detection is to be handled later\n }\n\n dataPoints.push(newData)\n }\n\n return {\n pointsPerSecond,\n amplitudeAlgorithm: algorithm,\n durationMs: fullAudioDurationMs,\n bitDepth,\n samples: totalSamples,\n numberOfChannels,\n sampleRate,\n dataPoints,\n amplitudeRange: {\n min: minAmplitude,\n max: maxAmplitude,\n },\n speakerChanges: [], // Placeholder for future speaker detection logic\n }\n }\n\n try {\n const result = extractWaveform(\n channelData,\n sampleRate,\n pointsPerSecond,\n algorithm\n )\n self.postMessage({\n command: 'features',\n result,\n })\n } catch (error) {\n console.error('[AudioFeaturesExtractor] Error in processing', error)\n self.postMessage({ error: error.message })\n } finally {\n // Do not close the worker so it can be re-used for subsequent messages\n // self.close();\n }\n}\n`\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siteed/expo-audio-stream",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "stream audio crossplatform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@expo/config-plugins": "~8.0.0",
|
|
41
|
+
"@siteed/publisher": "^0.4.15",
|
|
41
42
|
"@siteed/react-native-logger": "^0.10.0",
|
|
42
43
|
"@size-limit/preset-big-lib": "^11.1.4",
|
|
43
44
|
"@types/jest": "^29.5.12",
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
"prettier": "^3.2.5",
|
|
61
62
|
"react-native": "0.74.5",
|
|
62
63
|
"size-limit": "^11.1.4",
|
|
64
|
+
"ts-node": "^10.9.2",
|
|
63
65
|
"typedoc": "^0.26.5",
|
|
64
66
|
"typedoc-plugin-markdown": "^4.2.3",
|
|
65
67
|
"typescript": "~5.3.3"
|
package/plugin/build/index.js
CHANGED
|
@@ -11,7 +11,6 @@ const withRecordingPermission = (config) => {
|
|
|
11
11
|
config.modResults['NSMicrophoneUsageDescription'] ||
|
|
12
12
|
MICROPHONE_USAGE;
|
|
13
13
|
// Add notification permissions
|
|
14
|
-
// This is the correct key for iOS notifications
|
|
15
14
|
config.modResults['NSUserNotificationsUsageDescription'] =
|
|
16
15
|
NOTIFICATION_USAGE;
|
|
17
16
|
// Add notification style
|
|
@@ -25,15 +24,6 @@ const withRecordingPermission = (config) => {
|
|
|
25
24
|
existingBackgroundModes.push('remote-notification');
|
|
26
25
|
}
|
|
27
26
|
config.modResults.UIBackgroundModes = existingBackgroundModes;
|
|
28
|
-
// Required capabilities for notifications
|
|
29
|
-
if (!config.modResults.UIRequiredDeviceCapabilities) {
|
|
30
|
-
config.modResults.UIRequiredDeviceCapabilities = [];
|
|
31
|
-
}
|
|
32
|
-
const capabilities = config.modResults
|
|
33
|
-
.UIRequiredDeviceCapabilities;
|
|
34
|
-
if (!capabilities.includes('notification')) {
|
|
35
|
-
capabilities.push('notification');
|
|
36
|
-
}
|
|
37
27
|
return config;
|
|
38
28
|
});
|
|
39
29
|
// Android Configuration
|
package/plugin/src/index.ts
CHANGED
|
@@ -18,7 +18,6 @@ const withRecordingPermission: ConfigPlugin = (config: ExpoConfig) => {
|
|
|
18
18
|
MICROPHONE_USAGE
|
|
19
19
|
|
|
20
20
|
// Add notification permissions
|
|
21
|
-
// This is the correct key for iOS notifications
|
|
22
21
|
config.modResults['NSUserNotificationsUsageDescription'] =
|
|
23
22
|
NOTIFICATION_USAGE
|
|
24
23
|
|
|
@@ -36,16 +35,6 @@ const withRecordingPermission: ConfigPlugin = (config: ExpoConfig) => {
|
|
|
36
35
|
}
|
|
37
36
|
config.modResults.UIBackgroundModes = existingBackgroundModes
|
|
38
37
|
|
|
39
|
-
// Required capabilities for notifications
|
|
40
|
-
if (!config.modResults.UIRequiredDeviceCapabilities) {
|
|
41
|
-
config.modResults.UIRequiredDeviceCapabilities = []
|
|
42
|
-
}
|
|
43
|
-
const capabilities = config.modResults
|
|
44
|
-
.UIRequiredDeviceCapabilities as string[]
|
|
45
|
-
if (!capabilities.includes('notification')) {
|
|
46
|
-
capabilities.push('notification')
|
|
47
|
-
}
|
|
48
|
-
|
|
49
38
|
return config
|
|
50
39
|
})
|
|
51
40
|
|
package/publish.sh
CHANGED
|
@@ -44,12 +44,13 @@ echo "Generating updated documentation..."
|
|
|
44
44
|
yarn docgen
|
|
45
45
|
|
|
46
46
|
echo "Waiting while docs are generated..."
|
|
47
|
-
sleep
|
|
47
|
+
sleep 2
|
|
48
48
|
|
|
49
49
|
# Prepare and publish package
|
|
50
50
|
echo "Preparing and publishing package..."
|
|
51
51
|
yarn clean && yarn prepare && yarn npm publish
|
|
52
52
|
|
|
53
|
+
sleep 1
|
|
53
54
|
# Publish playground app
|
|
54
55
|
echo "Publishing playground app..."
|
|
55
56
|
cd ../../apps/playground
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReleaseConfig, DeepPartial } from '@siteed/publisher'
|
|
2
|
+
|
|
3
|
+
const config: DeepPartial<ReleaseConfig> = {
|
|
4
|
+
packageManager: 'yarn',
|
|
5
|
+
changelogFile: 'CHANGELOG.md',
|
|
6
|
+
conventionalCommits: true,
|
|
7
|
+
changelogFormat: 'conventional',
|
|
8
|
+
versionStrategy: 'independent',
|
|
9
|
+
bumpStrategy: 'prompt',
|
|
10
|
+
packValidation: {
|
|
11
|
+
enabled: false,
|
|
12
|
+
validateFiles: true,
|
|
13
|
+
validateBuildArtifacts: true,
|
|
14
|
+
},
|
|
15
|
+
git: {
|
|
16
|
+
tagPrefix: '',
|
|
17
|
+
requireCleanWorkingDirectory: true,
|
|
18
|
+
requireUpToDate: true,
|
|
19
|
+
requireUpstreamTracking: true,
|
|
20
|
+
commit: true,
|
|
21
|
+
push: true,
|
|
22
|
+
commitMessage:
|
|
23
|
+
'chore(expo-audio-stream): release @siteed/expo-audio-stream@${version}',
|
|
24
|
+
tag: true,
|
|
25
|
+
allowedBranches: ['main', 'master'],
|
|
26
|
+
remote: 'origin',
|
|
27
|
+
},
|
|
28
|
+
npm: {
|
|
29
|
+
publish: true,
|
|
30
|
+
registry: 'https://registry.npmjs.org',
|
|
31
|
+
tag: 'latest',
|
|
32
|
+
access: 'public',
|
|
33
|
+
},
|
|
34
|
+
hooks: {},
|
|
35
|
+
updateDependenciesOnRelease: false,
|
|
36
|
+
dependencyUpdateStrategy: 'none',
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default config
|
package/.cursorrules
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
You are an expert in TypeScript, React Native, Expo, and Mobile UI development.
|
|
3
|
-
|
|
4
|
-
Code Style and Structure
|
|
5
|
-
- Write concise, technical TypeScript code with accurate examples.
|
|
6
|
-
- Use functional and declarative programming patterns; avoid classes.
|
|
7
|
-
- Prefer iteration and modularization over code duplication.
|
|
8
|
-
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
|
|
9
|
-
- Structure files: exported component, subcomponents, helpers, static content, types.
|
|
10
|
-
- Follow Expo's official documentation for setting up and configuring your projects: https://docs.expo.dev/
|
|
11
|
-
|
|
12
|
-
Naming Conventions
|
|
13
|
-
- Favor named exports for components.
|
|
14
|
-
|
|
15
|
-
TypeScript Usage
|
|
16
|
-
- Use TypeScript for all code; prefer interfaces over types.
|
|
17
|
-
- Avoid enums; use maps instead.
|
|
18
|
-
- Prefer object parameters over multiple parameters.
|
|
19
|
-
- Use functional components with TypeScript interfaces.
|
|
20
|
-
- Use strict mode in TypeScript for better type safety.
|
|
21
|
-
|
|
22
|
-
Syntax and Formatting
|
|
23
|
-
- Use the "function" keyword for pure functions.
|
|
24
|
-
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
|
|
25
|
-
- Use declarative JSX.
|
|
26
|
-
- Use Prettier for consistent code formatting.
|
|
27
|
-
|
|
28
|
-
UI and Styling
|
|
29
|
-
- Use @siteed/design-system for UI components.
|
|
30
|
-
- Use Expo's built-in components for common UI patterns and layouts.
|
|
31
|
-
- Leverage react-native-reanimated and react-native-gesture-handler for performant animations and gestures.
|
|
32
|
-
|
|
33
|
-
Redux Tookit
|
|
34
|
-
- Use RTK Query for API calls.
|
|
35
|
-
- Use expo crypto to set default uuid id values.
|
|
36
|
-
- Use RTK Query's optimistic updates to update the UI immediately.
|
|
37
|
-
- Use RTK Query's undoable updates to undo the optimistic updates.
|
|
38
|
-
- Prefer useAppDispatch and useAppSelector hooks to have typed results.
|
|
39
|
-
|
|
40
|
-
Safe Area Management
|
|
41
|
-
- Use SafeAreaProvider from react-native-safe-area-context to manage safe areas globally in your app.
|
|
42
|
-
- Wrap top-level components with SafeAreaView to handle notches, status bars, and other screen insets on both iOS and Android.
|
|
43
|
-
- Use SafeAreaScrollView for scrollable content to ensure it respects safe area boundaries.
|
|
44
|
-
- Avoid hardcoding padding or margins for safe areas; rely on SafeAreaView and context hooks.
|
|
45
|
-
|
|
46
|
-
Performance Optimization
|
|
47
|
-
- Minimize the use of useState and useEffect; prefer context and reducers for state management.
|
|
48
|
-
- Use Expo's AppLoading and SplashScreen for optimized app startup experience.
|
|
49
|
-
- Optimize images: use WebP format where supported, include size data, implement lazy loading with expo-image.
|
|
50
|
-
- Implement code splitting and lazy loading for non-critical components with React's Suspense and dynamic imports.
|
|
51
|
-
- Profile and monitor performance using React Native's built-in tools and Expo's debugging features.
|
|
52
|
-
- Avoid unnecessary re-renders by memoizing components and using useMemo and useCallback hooks appropriately.
|
|
53
|
-
|
|
54
|
-
Navigation
|
|
55
|
-
- Use react-navigation for routing and navigation; follow its best practices for stack, tab, and drawer navigators.
|
|
56
|
-
- Leverage deep linking and universal links for better user engagement and navigation flow.
|
|
57
|
-
- Use dynamic routes with expo-router for better navigation handling.
|
|
58
|
-
|
|
59
|
-
State Management
|
|
60
|
-
- Use React Context and useReducer for managing global state.
|
|
61
|
-
- Leverage react-query for data fetching and caching; avoid excessive API calls.
|
|
62
|
-
- For complex state management, consider using Zustand or Redux Toolkit.
|
|
63
|
-
- Handle URL search parameters using libraries like expo-linking.
|
|
64
|
-
|
|
65
|
-
Storybook
|
|
66
|
-
- Use Storybook for UI component development and documentation.
|
|
67
|
-
- Prefer StoryFn to declare stories.
|
|
68
|
-
- Create stories for all components to ensure they work correctly in different scenarios.
|
|
69
|
-
- Use the @siteed/design-system for UI components in Storybook.
|
|
70
|
-
- Group stories next to the components they belong to.
|
|
71
|
-
|
|
72
|
-
Error Handling and Validation
|
|
73
|
-
- Use Zod for runtime validation and error handling.
|
|
74
|
-
- Implement proper error logging using Sentry or a similar service.
|
|
75
|
-
- Prioritize error handling and edge cases:
|
|
76
|
-
- Handle errors at the beginning of functions.
|
|
77
|
-
- Use early returns for error conditions to avoid deeply nested if statements.
|
|
78
|
-
- Avoid unnecessary else statements; use if-return pattern instead.
|
|
79
|
-
- Implement global error boundaries to catch and handle unexpected errors.
|
|
80
|
-
- Use expo-error-reporter for logging and reporting errors in production.
|
|
81
|
-
|
|
82
|
-
Testing
|
|
83
|
-
- Write unit tests using Jest and React Native Testing Library.
|
|
84
|
-
- Implement integration tests for critical user flows using Detox.
|
|
85
|
-
- Use Expo's testing tools for running tests in different environments.
|
|
86
|
-
- Consider snapshot testing for components to ensure UI consistency.
|
|
87
|
-
|
|
88
|
-
Security
|
|
89
|
-
- Sanitize user inputs to prevent XSS attacks.
|
|
90
|
-
- Use react-native-encrypted-storage for secure storage of sensitive data.
|
|
91
|
-
- Ensure secure communication with APIs using HTTPS and proper authentication.
|
|
92
|
-
- Use Expo's Security guidelines to protect your app: https://docs.expo.dev/guides/security/
|
|
93
|
-
|
|
94
|
-
Internationalization (i18n)
|
|
95
|
-
- Use react-native-i18n or expo-localization for internationalization and localization.
|
|
96
|
-
- Support multiple languages and RTL layouts.
|
|
97
|
-
- Ensure text scaling and font adjustments for accessibility.
|
|
98
|
-
|
|
99
|
-
Key Conventions
|
|
100
|
-
1. Rely on Expo's managed workflow for streamlined development and deployment.
|
|
101
|
-
2. Prioritize Mobile Web Vitals (Load Time, Jank, and Responsiveness).
|
|
102
|
-
3. Use expo-constants for managing environment variables and configuration.
|
|
103
|
-
4. Use expo-permissions to handle device permissions gracefully.
|
|
104
|
-
5. Implement expo-updates for over-the-air (OTA) updates.
|
|
105
|
-
6. Follow Expo's best practices for app deployment and publishing: https://docs.expo.dev/distribution/introduction/
|
|
106
|
-
7. Ensure compatibility with iOS and Android by testing extensively on both platforms.
|
|
107
|
-
|
|
108
|
-
API Documentation
|
|
109
|
-
- Use Expo's official documentation for setting up and configuring your projects: https://docs.expo.dev/
|
|
110
|
-
|
|
111
|
-
Refer to Expo's documentation for detailed information on Views, Blueprints, and Extensions for best practices.
|
|
112
|
-
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/debug/jniLibs"/></dataSet></merger>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/debug/shaders"/></dataSet></merger>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/main/assets"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/src/debug/assets"/></dataSet><dataSet config="generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/FD/Projects/expo-audio-stream/packages/expo-audio-stream/android/build/intermediates/shader_assets/debug/out"/></dataSet></merger>
|
|
Binary file
|