-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Stream.read blocks until audio is playing #20
Comments
Thank you for that suggestion! I will see if I can implement the first solution you suggested. Best, |
This would be very useful. Hopefully it's implemented soon. +1 |
The silence isn't perfect yet, but there you go. |
Usagestream = p.open(format = pyaudio.paInt16,
channels = channelcount,
rate = int(device_info["defaultSampleRate"]),
input = True,
frames_per_buffer = defaultframes,
input_device_index = device_info["index"],
as_loopback = useloopback,
wasapi_fill_silence = True) |
Or instead of silence I could return NULL when the loopback output stream has no frames available. |
Sounds like a great idea, but this would make the loopback streams a special edge case, which don't always return audio like all the other streams. Considering the loopback streams are special anyway however, I think both ways would be fine from a design perspective and having an specific return value for when no audio is available could be useful I guess. |
I downloaded this version with wasapi_fill_silence but it's giving me an error in init(), saying that this parameter doesn't exist |
Could you please drop the .wheel package of this version with wasapi? |
When creating a stream with
as_loopback=True
, theread
method on the created stream will block until audio is being played. I'm not sure if this is the desired behavior, but it's certainly unexpected for me. I would suggest the read method to instead just return silence, instead of blocking until data is available.This blog post mentions this problem, with the solution of running an application which just outputs silence, but I don't think this is a particularly useful solution for a library.
The text was updated successfully, but these errors were encountered: