getAudioDuration

fun getAudioDuration(byteCount: Int, sampleRate: Int): Int

Gets the audio duration in milliseconds from the number of bytes of a PCM16 formatted data and its sample rate.

Return

The duration of the audio in milliseconds.

Parameters

byteCount

The number of bytes of the PCM16 formatted data.

sampleRate

The sample rate of the data.