attach Processor
Attaches a processor function to the audio stream, which will be called with the audio data before it is played. The processor function can be used to modify the audio data in real-time, such as applying effects or filters. The processor function should take a byte array as input, which will contain the audio data to be processed. 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 processor callback can be attached at a time across all AudioStream instances. Attaching a new processor callback will replace the previous one.
Parameters
The callback function to attach, which will be called with the audio data before it is played. The processor function can be used to modify the audio data in real-time, such as applying effects or filters. The processor function should take a byte array as input, which will contain the audio data to be processed. 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.