googleSpeech_mic.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:googleSpeech_with_NaverTTS 作者: chandong83 项目源码 文件源码
def __enter__(self):
        self._audio_interface = pyaudio.PyAudio()
        self._audio_stream = self._audio_interface.open(
            format=pyaudio.paInt16,
            # The API currently only supports 1-channel (mono) audio
            # https://goo.gl/z757pE
            channels=1, rate=self._rate,
            input=True, frames_per_buffer=self._chunk,
            # Run the audio stream asynchronously to fill the buffer object.
            # This is necessary so that the input device's buffer doesn't
            # overflow while the calling thread makes network requests, etc.
            stream_callback=self._fill_buffer,
        )

        self.closed = False

        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号