AudioExtractor

open class AudioExtractor

Extracts audio from media files into EmbeddedAudioSource that is usable for creating SoundAnnotation.

Supported formats depend on the device (see https://developer.android.com/guide/topics/media/media-formats).

Constructors

Link copied to clipboard
constructor(@NonNull context: Context, @NonNull contentUri: Uri)
Creates audio extractor for media file at contentUri.

Functions

Link copied to clipboard
Extracts selected audio track as an EmbeddedAudioSource that can be set on .
Link copied to clipboard
Extracts selected audio track as an EmbeddedAudioSource that can be set on , asynchronously.
Link copied to clipboard
Number of audio tracks in the media file.
Link copied to clipboard
Returns selected track duration in milliseconds.
Link copied to clipboard
open fun selectAudioTrack(audioTrackIndex: Int)
Selects audio track for decoding.