swhear.py 文件源码

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

项目:diyECG-1opAmp 作者: swharden 项目源码 文件源码
def __init__(self,device=None,rate=None,chunk=4096,maxMemorySec=5):
        """
        Prime the Ear class to access audio data. Recording won't start
        until stream_start() is called.
        - if device is none, will use first valid input (not system default)
        - if a rate isn't specified, the lowest usable rate will be used.
        """

        # configuration
        self.chunk = chunk # doesn't have to be a power of 2
        self.maxMemorySec = maxMemorySec # delete if more than this around
        self.device=device
        self.rate=rate

        # internal variables
        self.chunksRecorded=0
        self.p=pyaudio.PyAudio() #keep this forever
        self.t=False #later will become threads

    ### SOUND CARD TESTING
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号