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
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)
2 Comments
Gus
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.
John Wiseman
When I tried your pastie code on OS X, I got an underflow exception.