attachMixedProcessor

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

Attaches a processor function to the audio mixer, which will be called with the mixed audio data before it is played. The processor function can be used to modify the mixed audio data in real-time, such as applying effects or filters to the final output. The processor function should take a byte array as input, which will contain the mixed audio data to be processed. The size of the byte array will be equal to the number of frames requested by the audio mixer multiplied by the sample size and number of channels of the audio mixer.

Only one mixed processor callback can be attached at a time. Attaching a new mixed processor callback will replace the previous one.

Parameters

callback

The callback function to attach, which will be called with the mixed audio data before it is played. The processor function can be used to modify the mixed audio data in real-time, such as applying effects or filters to the final output. The processor function should take a byte array as input, which will contain the mixed audio data to be processed. The size of the byte array will be equal to the number of frames requested by the audio mixer multiplied by the sample size and number of channels of the audio mixer.

Throws

IllegalStateException

if a mixed processor callback is already attached. Only one mixed processor callback can be attached at a time.