RecordingConfig
@siteed/expo-audio-studio / RecordingConfig
Interface: RecordingConfig
Defined in: src/ExpoAudioStream.types.ts:378
Properties
android?
optionalandroid:AndroidConfig
Defined in: src/ExpoAudioStream.types.ts:427
Android-specific configuration
autoResumeAfterInterruption?
optionalautoResumeAfterInterruption:boolean
Defined in: src/ExpoAudioStream.types.ts:456
Whether to automatically resume recording after an interruption (default is false)
bufferDurationSeconds?
optionalbufferDurationSeconds:number
Defined in: src/ExpoAudioStream.types.ts:486
Buffer duration in seconds. Controls the size of audio buffers used during recording. Smaller values reduce latency but increase CPU usage. Larger values improve efficiency but increase latency.
Platform Notes:
- iOS/macOS: Minimum effective 0.1s, uses accumulation below
- Android: Respects all sizes within hardware limits
- Web: Fully configurable
Default: undefined (uses platform default ~23ms at 44.1kHz) Recommended: 0.01 - 0.5 seconds Optimal iOS: >= 0.1 seconds
channels?
optionalchannels:1|2
Defined in: src/ExpoAudioStream.types.ts:383
Number of audio channels (1 for mono, 2 for stereo)
deviceDisconnectionBehavior?
optionaldeviceDisconnectionBehavior:DeviceDisconnectionBehaviorType
Defined in: src/ExpoAudioStream.types.ts:470
How to handle device disconnection during recording
deviceId?
optionaldeviceId:string
Defined in: src/ExpoAudioStream.types.ts:467
ID of the device to use for recording (if not specified, uses default)
enableProcessing?
optionalenableProcessing:boolean
Defined in: src/ExpoAudioStream.types.ts:421
Enable audio processing (default is false)
encoding?
optionalencoding:EncodingType
Defined in: src/ExpoAudioStream.types.ts:400
Encoding type for the recording.
Platform limitations:
pcm_8bit: Android only (iOS/Web will fallback topcm_16bitwith warning)pcm_16bit: All platforms (recommended for cross-platform compatibility)pcm_32bit: All platforms
The library will automatically validate and adjust the encoding based on platform capabilities. A warning will be logged if fallback is required.
Default
'pcm_16bit'
See
features?
optionalfeatures:AudioFeaturesOptions
Defined in: src/ExpoAudioStream.types.ts:436
Feature options to extract during audio processing
filename?
optionalfilename:string
Defined in: src/ExpoAudioStream.types.ts:464
Optional filename for the recording (uses UUID if not provided)
interval?
optionalinterval:number
Defined in: src/ExpoAudioStream.types.ts:403
Interval in milliseconds at which to emit recording data (minimum: 10ms)
intervalAnalysis?
optionalintervalAnalysis:number
Defined in: src/ExpoAudioStream.types.ts:406
Interval in milliseconds at which to emit analysis data (minimum: 10ms)
ios?
optionalios:IOSConfig
Defined in: src/ExpoAudioStream.types.ts:424
iOS-specific configuration
keepAwake?
optionalkeepAwake:boolean
Defined in: src/ExpoAudioStream.types.ts:409
Keep the device awake while recording (default is false)
notification?
optionalnotification:NotificationConfig
Defined in: src/ExpoAudioStream.types.ts:418
Configuration for the notification
onAudioAnalysis()?
optionalonAudioAnalysis: (_) =>Promise<void>
Defined in: src/ExpoAudioStream.types.ts:442
Callback function to handle audio features extraction results
Parameters
_
AudioAnalysisEvent
Returns
Promise<void>
onAudioStream()?
optionalonAudioStream: (_) =>Promise<void>
Defined in: src/ExpoAudioStream.types.ts:439
Callback function to handle audio stream data
Parameters
_
Returns
Promise<void>
onRecordingInterrupted()?
optionalonRecordingInterrupted: (_) =>void
Defined in: src/ExpoAudioStream.types.ts:459
Optional callback to handle recording interruptions
Parameters
_
Returns
void
output?
optionaloutput:OutputConfig
Defined in: src/ExpoAudioStream.types.ts:453
Configuration for audio output files
Examples:
- Primary only (default):
{ primary: { enabled: true } } - Compressed only:
{ primary: { enabled: false }, compressed: { enabled: true, format: 'aac' } } - Both outputs:
{ compressed: { enabled: true } } - Streaming only:
{ primary: { enabled: false } }
outputDirectory?
optionaloutputDirectory:string
Defined in: src/ExpoAudioStream.types.ts:462
Optional directory path where output files will be saved
sampleRate?
optionalsampleRate:SampleRate
Defined in: src/ExpoAudioStream.types.ts:380
Sample rate for recording in Hz (16000, 44100, or 48000)
segmentDurationMs?
optionalsegmentDurationMs:number
Defined in: src/ExpoAudioStream.types.ts:433
Duration of each segment in milliseconds for analysis (default: 100)
showNotification?
optionalshowNotification:boolean
Defined in: src/ExpoAudioStream.types.ts:412
Show a notification during recording (default is false)
showWaveformInNotification?
optionalshowWaveformInNotification:boolean
Defined in: src/ExpoAudioStream.types.ts:415
Show waveform in the notification (Android only, when showNotification is true)
web?
optionalweb:WebConfig
Defined in: src/ExpoAudioStream.types.ts:430
Web-specific configuration options