Asking for a feature of the callback
To write the code in an OOP style, I had a problem to inject a queue into the callback. I did this with a closure with success.
But the success ended when using sounddevice with multiprocessing.process. I could use the callback when the callback was a static method without the wrapper of the closure. This lacks of course a reference to a queue.
So my proposal is to add a parameter for the callback, providing a python reference for a queue or another object instance, which can be provided by instancing a Stream.
Can you please give a minimal example where a closure cannot be used?
This can either be a broken example with the current API or a fictitious example with the suggested new API.