コード例 #1
0
ファイル: pyaudio.py プロジェクト: endolith/PyAudio
    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)
コード例 #2
0
ファイル: pyaudio.py プロジェクト: chai41104/NLP
    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)
コード例 #3
0
ファイル: play_wave.py プロジェクト: b2220333/PyAudio-1
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()