TrimAudioOptions
@siteed/expo-audio-studio / TrimAudioOptions
Interface: TrimAudioOptions
Defined in: src/ExpoAudioStream.types.ts:718
Options for configuring the audio trimming operation.
Properties
decodingOptions?
optionaldecodingOptions:DecodingConfig
Defined in: src/ExpoAudioStream.types.ts:798
Options for decoding the input audio file.
- See
DecodingConfigfor details.
endTimeMs?
optionalendTimeMs:number
Defined in: src/ExpoAudioStream.types.ts:750
The end time in milliseconds for the 'single' mode.
- If not provided, trimming extends to the end of the audio.
fileUri
fileUri:
string
Defined in: src/ExpoAudioStream.types.ts:722
The URI of the audio file to trim.
mode?
optionalmode:"single"|"keep"|"remove"
Defined in: src/ExpoAudioStream.types.ts:731
The mode of trimming to apply.
'single': Trims the audio to a single range defined bystartTimeMsandendTimeMs.'keep': Keeps the specifiedrangesand removes all other portions of the audio.'remove': Removes the specifiedrangesand keeps the remaining portions of the audio.
Default
'single'
outputFileName?
optionaloutputFileName:string
Defined in: src/ExpoAudioStream.types.ts:755
The name of the output file. If not provided, a default name will be generated.
outputFormat?
optionaloutputFormat:object
Defined in: src/ExpoAudioStream.types.ts:760
Configuration for the output audio format.
bitDepth?
optionalbitDepth:number
The bit depth of the output audio, applicable to PCM formats like 'wav'.
- If not provided, the input audio's bit depth is used.
bitrate?
optionalbitrate:number
The bitrate of the output audio in bits per second, applicable to compressed formats like 'aac'.
- If not provided, a default bitrate is used based on the format.
channels?
optionalchannels:number
The number of channels in the output audio (e.g., 1 for mono, 2 for stereo).
- If not provided, the input audio's channel count is used.
format
format:
"aac"|"opus"|"wav"
The format of the output audio file.
'wav': Waveform Audio File Format (uncompressed).'aac': Advanced Audio Coding (compressed). Not supported on web platforms.'opus': Opus Interactive Audio Codec (compressed).
sampleRate?
optionalsampleRate:number
The sample rate of the output audio in Hertz (Hz).
- If not provided, the input audio's sample rate is used.
ranges?
optionalranges:TimeRange[]
Defined in: src/ExpoAudioStream.types.ts:738
An array of time ranges to keep or remove, depending on the mode.
- Required for
'keep'and'remove'modes. - Ignored when
modeis'single'.
startTimeMs?
optionalstartTimeMs:number
Defined in: src/ExpoAudioStream.types.ts:744
The start time in milliseconds for the 'single' mode.
- If not provided, trimming starts from the beginning of the audio (0 ms).