Moved mic recording constants inside MicrophoneRecognizer

This commit is contained in:
Vin 2013-12-17 22:05:09 +00:00
parent 788b3acebf
commit 614ad0d4cc

View file

@ -10,10 +10,6 @@ import sys
import time import time
import array import array
CHUNK = 8192 # 44100 is a multiple of 1225
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
class BaseRecognizer(object): class BaseRecognizer(object):
@ -65,6 +61,11 @@ class WaveFileRecognizer(BaseRecognizer):
class MicrophoneRecognizer(BaseRecognizer): class MicrophoneRecognizer(BaseRecognizer):
CHUNK = 8192 # 44100 is a multiple of 1225
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
def __init__(self, dejavu, seconds=None) def __init__(self, dejavu, seconds=None)
super(BaseRecognizer, self).__init__(dejavu) super(BaseRecognizer, self).__init__(dejavu)
self.audio = pyaudio.PyAudio() self.audio = pyaudio.PyAudio()