format

fun format(sampleRate: Int, sampleSize: Int, channels: Int)

Formats this wave with the specified sample rate, sample size, and number of channels, which can be set to any positive integer values.

After calling this function, the wave will be modified to have the specified sample rate, sample size, and number of channels. The audio data of the wave will be resampled and reformatted accordingly to match the new format.

Parameters

sampleRate

The sample rate to format the wave with, which must be a positive integer.

sampleSize

The sample size to format the wave with, which must be a positive integer.

channels

The number of channels to format the wave with, which must be a positive integer.

Throws

IllegalArgumentException

if the sample rate, sample size, or channels are not positive integers.