@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/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];