@edkimmel/expo-audio-stream 0.4.2 → 0.5.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/NATIVE_EVENTS.md +37 -0
- package/android/src/main/java/expo/modules/audiostream/ExpoPlayAudioStreamModule.kt +5 -0
- package/android/src/main/java/expo/modules/audiostream/pipeline/AudioPipeline.kt +92 -2
- package/android/src/main/java/expo/modules/audiostream/pipeline/PipelineIntegration.kt +14 -0
- package/build/events.d.ts +4 -0
- package/build/events.d.ts.map +1 -1
- package/build/events.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +8 -3
- package/build/index.js.map +1 -1
- package/build/pipeline/index.d.ts +14 -1
- package/build/pipeline/index.d.ts.map +1 -1
- package/build/pipeline/index.js +15 -0
- package/build/pipeline/index.js.map +1 -1
- package/build/pipeline/types.d.ts +14 -0
- package/build/pipeline/types.d.ts.map +1 -1
- package/build/pipeline/types.js.map +1 -1
- package/build/types.d.ts +8 -0
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/ios/AudioPipeline.swift +67 -2
- package/ios/ExpoPlayAudioStreamModule.swift +14 -0
- package/ios/Microphone.swift +116 -25
- package/ios/PipelineIntegration.swift +11 -1
- package/package.json +1 -2
- package/plugin/build/index.js +5 -0
- package/plugin/src/index.ts +5 -0
- package/src/events.ts +4 -0
- package/src/index.ts +12 -2
- package/src/pipeline/index.ts +17 -0
- package/src/pipeline/types.ts +15 -0
- package/src/types.ts +9 -0
package/src/types.ts
CHANGED
|
@@ -129,10 +129,19 @@ export interface RecordingConfig {
|
|
|
129
129
|
enableProcessing?: boolean; // Boolean to enable/disable audio processing (default is false)
|
|
130
130
|
pointsPerSecond?: number; // Number of data points to extract per second of audio (default is 1000)
|
|
131
131
|
onAudioStream?: (event: AudioDataEvent) => Promise<void>; // Callback function to handle audio stream
|
|
132
|
+
/** Fired when the native layer reports a mid-recording error (e.g. system
|
|
133
|
+
* interruption like Siri or a phone call). The consumer should treat the
|
|
134
|
+
* recording session as terminated and clean up. */
|
|
135
|
+
onError?: (event: MicrophoneErrorEvent) => void;
|
|
132
136
|
/** Optional frequency band crossover configuration. */
|
|
133
137
|
frequencyBandConfig?: FrequencyBandConfig;
|
|
134
138
|
}
|
|
135
139
|
|
|
140
|
+
export interface MicrophoneErrorEvent {
|
|
141
|
+
code: string;
|
|
142
|
+
message: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
136
145
|
export interface Chunk {
|
|
137
146
|
text: string;
|
|
138
147
|
timestamp: [number, number | null];
|