setCallback

fun setCallback(callback: (ERROR CLASS: Symbol not found for UByteArray) -> Unit)

Sets a callback function to be called when the audio stream needs more data. The callback function should take a byte array as input, which will be filled with the audio data to be streamed. The size of the byte array will be equal to the number of frames requested by the audio stream multiplied by the sample size and number of channels of the audio stream.

Only one stream callback can be set at a time across all AudioStream instances. Setting a new stream callback will replace the previous one.

Parameters

callback

The callback function to set, which will be called when the audio stream needs more data. The callback function should take a byte array as input, which will be filled with the audio data to be streamed. The size of the byte array will be equal to the number of frames requested by the audio stream multiplied by the sample size and number of channels of the audio stream.