Open arminveres opened 1 year ago
Did you try running the tone generating code in another thread than the gui code?
I haven't managed to put it into another thread yet, although I would prefer to keep it single threaded for the moment, if possible. EDIT: I.e., I would like for it to be synchronous, whereas with separate threads I am sure that it would not be. I made an implementation with message passing, which works, but it's completely asynchronous. I'd really appreciate, if someone could point me in the right direction.
I am currently working on an algorithm visualization tool, asking to this for a university project, hence why the repo is private at the moment. My goal is to output a tone between a certain range when sorting a bar.
I integrated the
bleep
example into my logic and while it works for very low frame rates, say 1-5 fps, it blocks the drawing of the window otherwise. I am assuming this is caused bystd::thread::sleep
.Is there an other non blocking way to output a tone, as if I remove the sleep duration, no tone is output at all. i am calling
run
mutliple times in each frame.If necessary, I can make the repository public.
If relevant: OS: Fedora Workstation 38