sound.resample

sound

resample(buf, src_rate, dst_rate) -> resampled, err

Resample a buffer to a different sample rate

Linear-interpolation resample, so an asset at one sample rate plays at the correct pitch on a device at another (pass dev:rate() as dst_rate).

Returns a new buffer; the source is not modified. Returns nil and an error string on failure.