/** * Audio session category for iOS */ export type AudioSessionCategory = 'ambient' | 'soloAmbient' | 'playback' | 'record' | 'playAndRecord' | 'multiRoute'; /** * Audio session mode for iOS */ export type AudioSessionMode = 'default' | 'voiceChat' | 'gameChat' | 'videoRecording' | 'measurement' | 'moviePlayback' | 'videoChat' | 'spokenAudio'; /** * Audio session options for iOS */ export type AudioSessionOptions = { /** Mix with other audio apps */ mixWithOthers?: boolean; /** Duck other audio when this app plays */ duckOthers?: boolean; /** Allow Bluetooth audio */ allowBluetooth?: boolean; /** Allow Bluetooth A2DP */ allowBluetoothA2DP?: boolean; /** Default to speaker instead of receiver */ defaultToSpeaker?: boolean; /** Allow AirPlay audio */ allowAirPlay?: boolean; }; /** * * Audio session configuration */ export type AudioSessionConfig = { /** Audio session category */ category: AudioSessionCategory; /** Audio session mode */ mode?: AudioSessionMode; /** Audio session options */ options?: AudioSessionOptions; }; /** * Module event listeners interface */ export type ExpoAudioStudioModuleEvents = { onPlayerStatusChange: (_params: PlayerStatusChangeEvent) => void; onRecorderAmplitude: (_params: AudioMeteringEvent) => void; onRecorderStatusChange: (_params: AudioRecordingStateChangeEvent) => void; onVoiceActivityDetected: (_params: VoiceActivityEvent) => void; /** * returns audio chunk Base64 string */ onAudioChunk: (_params: AudioChunkEvent) => void; }; /** * Audio metering event containing amplitude information */ export type AudioMeteringEvent = { /** Audio amplitude in decibels (dB) */ amplitude: number; }; /** * Player status change event */ export type PlayerStatusChangeEvent = { /** Whether audio is currently playing */ isPlaying: boolean; /** Whether playback just finished naturally */ didJustFinish: boolean; }; /** * Recording state change event */ export type AudioRecordingStateChangeEvent = { /** Current recording status */ status: RecordingStatus; }; /** * Recording status enumeration */ export type RecordingStatus = 'recording' | 'stopped' | 'paused' | 'resumed' | 'failed' | 'error' | 'interrupted'; /** * Enhanced voice activity detection event with comprehensive data */ export type VoiceActivityEvent = { /** Whether voice/speech is currently detected */ isVoiceDetected: boolean; /** Confidence level (0.0-1.0) */ confidence: number; /** Timestamp of detection */ timestamp: number; /** Whether this represents a state change */ isStateChange: boolean; /** Previous detection state (for state changes) */ previousState?: boolean; /** Event type for better handling */ eventType: 'speech_start' | 'speech_continue' | 'silence_start' | 'silence_continue'; }; /** * Audio chunk event containing Base64 string */ export type AudioChunkEvent = { /** Base64 encoded audio chunk */ base64: string; }; /** * Permission status enumeration */ export type PermissionStatus = 'granted' | 'denied' | 'undetermined' | 'restricted'; /** * Permission response object */ export type PermissionResponse = { /** Current permission status */ status: PermissionStatus; /** Whether permission can be requested again */ canAskAgain: boolean; /** Whether permission is currently granted */ granted: boolean; }; /** * Detailed player status information */ export type PlayerStatusResult = { /** Whether audio is currently playing */ isPlaying: boolean; /** Current playback position in seconds */ currentTime: number; /** Total duration in seconds */ duration: number; /** Current playback speed multiplier */ speed: number; }; /** * Playback speed range (0.5x to 2.0x) */ export type PlaybackSpeed = number; /** * Recording state information */ export type RecordingState = { /** Whether currently recording */ isRecording: boolean; /** Whether recording is paused */ isPaused: boolean; /** Current recording status */ status: RecordingStatus; /** Current amplitude level in dB */ amplitude: number; /** Recording duration in seconds */ duration: number; }; /** * Audio amplitude analysis result */ export type AudioAmplitudeResult = { /** Whether the analysis was successful */ success: boolean; /** Array of amplitude values in decibels (dB) for each bar */ amplitudes: number[]; /** Audio duration in seconds */ duration: number; /** Audio sample rate in Hz */ sampleRate: number; /** Number of amplitude bars generated */ barsCount: number; /** Error message if analysis failed */ error?: string; }; /** * Duration result in seconds */ export type DurationResult = number; /** * Audio handler error types */ export type AudioHandlerError = 'NoPlayerException' | 'NoRecorderException' | 'PlaybackFailedException' | 'RecordingFailedException' | 'PermissionDeniedException' | 'FileNotFoundException' | 'InvalidParameterException' | 'AudioSessionException' | 'UnsupportedOperationException'; /** * Error response object */ export type ErrorResponse = { /** Error type */ type: AudioHandlerError; /** Human-readable error message */ message: string; /** Additional error details */ details?: any; }; //# sourceMappingURL=types.d.ts.map