Open Boscop opened 3 years ago
I don't know if you are aware of the following (ignore it if you are): it seems that WasApi will not start calling the callback until something is actually playing on an audio output (real device or virtual device like HiFi Cable). For instance on some systems if the speakers are muted, depending on the hardware, the callback will not be called at all.
Was this bug ever worked around? It's also happening to me where the data_callback
is not being called.
Also I am playing audio on the device aside from my own application and it's still not using the callback.
I am also using winit.
I'm trying to do Wasapi loopback capture but it's not working: Even though my input stream is spawned, the stream callback never gets called. Why could that be?
It prints this:
But it should ALSO print
wave_reader called
(from inside thewave_reader
stream callback), but it never prints this and so I'm not receiving any audio frames through thechannel
in my application.I based my code on the implementation of loopback capture in https://github.com/dheijl/swyh-rs: https://github.com/dheijl/swyh-rs/blob/e6709b2f546af6cf272ded9529f6dc5d95145453/src/main.rs#L849
In swyh it apparently works (but I can't test that application because I don't have a streaming server/receiver). I just refactored the code a little bit, but apart from that it's the same. Any idea why the stream callback (
wave_reader
) doesn't get called?(Note: On linux,
wave_reader
does get called and I receive audio frames over the channel. They are all0.0
, but that's a different issue, probably a linux issue rather than cpal issue?)Btw, if you're wondering why I'm spawning a new thread (compared to swyh): If I don't create the stream in the separate thread, I get this:
It's this issue: https://github.com/RustAudio/rodio/issues/214 My application uses winit, and apparently this combination causes this issue: https://github.com/RustAudio/rodio/issues/214#issuecomment-640979469 https://github.com/rust-windowing/winit/issues/1185 That's why I'm spawning a new thread for the stream (which I'm then keeping alive to prevent the stream from getting dropped). But that's the only difference to
swyh
that I see. So I'm wondering why the stream callback is not being called.