framesToTime

fun framesToTime(frames: IntArray, sampleRate: Int, hopLength: Int): FloatArray

Convert frame indices to time in seconds.

Usage

Kotlin

val times = SonixAudioUtils.framesToTime(intArrayOf(0, 10, 20), sampleRate = 16000, hopLength = 512)
// times: [0.0, 0.32, 0.64]

Swift

let times = SonixAudioUtils.framesToTime(frames: [0, 10, 20], sampleRate: 16000, hopLength: 512)
// times: [0.0, 0.32, 0.64]

Return

Time in seconds for each frame.

Parameters

frames

Frame indices.

sampleRate

Sample rate in Hz (must be positive).

hopLength

Hop length in samples (must be positive).