SonixFrames

Utilities for converting between frame indices and time. Ported from musicmuni_common.conversions.frames

Functions

Link copied to clipboard
fun framesToTime(frame: Int, sampleRate: Int, hopLength: Int): Double

Convert frame index to time (in seconds).

fun framesToTime(frames: List<Int>, sampleRate: Int, hopLength: Int): List<Double>

Convert list of frame indices to times.

Link copied to clipboard
fun timeToFrames(time: Double, sampleRate: Int, hopLength: Int): Int

Convert time (in seconds) to frame index.

fun timeToFrames(times: List<Double>, sampleRate: Int, hopLength: Int): List<Int>

Convert list of times to frame indices.