cpal icon indicating copy to clipboard operation
cpal copied to clipboard

Question About "build_output_stream"

Open metasophiea opened this issue 4 years ago • 0 comments

Hello, I apologise for writing here if this is the wrong place, but I couldn't find an obvious 'questions' forum

Just a simple question; when calling the build_output_stream function, you provide a data callback which is called by the system when necessary. My question is, if you run this function twice for the same device - with different callbacks - are those callbacks called on different threads, or sequentially on the same thread? Perhaps there is a thread per device?

My intention here is to have an additional audio processing thread which is not associated with any device, but is being called regularly like those which are. I could set one up using "std:: thread::spawn", but I'd like a repeated call to be made that is congruent with those made within "build_output_stream". I therefore had the idea to simply call "build_output_stream" again to run this audio processor.

Let me know if I've posted in the wrong place,

Thanks, Brandon

metasophiea avatar Jul 06 '21 16:07 metasophiea