示例#1
0
文件: pyaudio.py 项目: chai41104/NLP
    def get_read_available(self):
        """
        Return the number of frames that can be read without waiting.

        :rtype: integer
        """

        return pa.get_stream_read_available(self._stream)
示例#2
0
文件: pyaudio.py 项目: FOSSRIT/PyTalk
    def get_read_available(self):
        """
        Return the number of frames that can be read without waiting.

        :rtype: integer
        """

        return pa.get_stream_read_available(self._stream)
示例#3
0
文件: bad.py 项目: endolith/PyAudio
print("* initializing")
_portaudio.initialize()

print("* opening")
stream = _portaudio.open(format=get_format_from_width(wf.getsampwidth()),
                         channels=wf.getnchannels(),
                         rate=wf.getframerate(),
                         input=True,
                         output=True)

data = wf.readframes(chunk)

print("* starting stream")
_portaudio.start_stream(stream)

while data != '':
    _portaudio.write_stream(stream, data, chunk)
    data = wf.readframes(chunk)

# OK...
_portaudio.close(stream)

# Fixed -- no longer relevant. An exception will be thrown.

# -----DEPRECATED COMMENT:
# BUT! don't re-use the stream object after closing it!
# Depending on the platform, this might crash Python.
print("* CRASH ----------*")
print(_portaudio.get_stream_read_available(stream))
示例#4
0
文件: bad.py 项目: DNESS/PyAudio
print "* initializing"
_portaudio.initialize()

print "* opening"
stream = _portaudio.open(format = get_format_from_width(wf.getsampwidth()),
                         channels = wf.getnchannels(),
                         rate = wf.getframerate(),
                         input = True,
                         output = True)

data = wf.readframes(chunk)

print "* starting stream"
_portaudio.start_stream(stream)

while data != '':
    _portaudio.write_stream(stream, data, chunk)
    data = wf.readframes(chunk)

# OK...
_portaudio.close(stream)

# Fixed -- no longer relevant. An exception will be thrown.

# -----DEPRECATED COMMENT:
# BUT! don't re-use the stream object after closing it!
# Depending on the platform, this might crash Python.
print "* CRASH ----------*"
print _portaudio.get_stream_read_available(stream)