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
评论列表
文章目录