getDuration

open fun getDuration(@NonNull fileUri: Uri): Integer

Get length of the currently playing file.

Return

Length of the currently playing file, in milliseconds.




Get length of a stream.

Return

Length of the passed stream, in milliseconds. null if the stream does not contain valid sound data.

Parameters

stream

Stream to get length of. Should support mark. FileInputStream is supported even without mark.


open fun getDuration(fileDescriptor: Integer): Integer

Get length of a file.

Return

Length of the passed file, in milliseconds. null if the file does not exist or does not contain valid sound data.

Parameters

fileDescriptor

File to get length of.