2

PyAudio is based on PortAudio. Is there anyway to detect a buffer under/overflow for writing/reading from an audio stream in PyAudio?

1 Answer 1

2

According to the documentation you can raise an exception on underflow when doing a write on a Stream class:

Stream.write(self, frames, num_frames=None, exception_on_underflow=True)

Sign up to request clarification or add additional context in comments.

2 Comments

I haven't gotten this to work. This code ( pastie.org/3147232 ) is similar to an example on the PyAudio page with a silly for-loop to induce buffer underflows, but no exception gets thrown. I do hear the breaks in the audio, though.
When I tried your pastie code on OS X, I got an underflow exception.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.