def get_write_available(self): """ Return the number of frames that can be written without waiting. :rtype: int """ return pa.get_stream_write_available(self._stream)
def get_write_available(self): """ Return the number of frames that can be written without waiting. :rtype: integer """ return pa.get_stream_write_available(self._stream)
print "* initializing" _portaudio.initialize() print "* opening" stream = _portaudio.open(rate = wf.getframerate(), channels = wf.getnchannels(), format = get_format_from_width(wf.getsampwidth()), output = True) data = wf.readframes(chunk) print "* starting stream" _portaudio.start_stream(stream) print "available: %d" % _portaudio.get_stream_write_available(stream) while data != '': _portaudio.write_stream(stream, data, chunk) data = wf.readframes(chunk) print "* stopping stream" _portaudio.stop_stream(stream) print "* closing stream" _portaudio.close(stream) # always match an initialize() call with a terminate() _portaudio.terminate()