toFloatArray
Returns a copy of the samples, interleaved by channel: frameCount frames of channels values each, meant to play at sampleRate. Changing the copy does not change the receiver.
Samples
val samples = AudioSamples(floatArrayOf(0.1f, -0.1f, 0.5f, -0.5f), channels = 2, sampleRate = 48000)
val copy = samples.toFloatArray()
copy[0] = 1f
assertPrints(copy.toList(), "[1.0, -0.1, 0.5, -0.5]")
assertPrints(samples[0, 0], "0.1")Content copied to clipboard