From 614ad0d4cc1a2d92d3540aa73e39435e07638afc Mon Sep 17 00:00:00 2001 From: Vin Date: Tue, 17 Dec 2013 22:05:09 +0000 Subject: [PATCH] Moved mic recording constants inside MicrophoneRecognizer --- dejavu/recognize.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dejavu/recognize.py b/dejavu/recognize.py index d743b16..024e62f 100755 --- a/dejavu/recognize.py +++ b/dejavu/recognize.py @@ -10,10 +10,6 @@ import sys import time import array -CHUNK = 8192 # 44100 is a multiple of 1225 -FORMAT = pyaudio.paInt16 -CHANNELS = 2 -RATE = 44100 class BaseRecognizer(object): @@ -65,6 +61,11 @@ class WaveFileRecognizer(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) super(BaseRecognizer, self).__init__(dejavu) self.audio = pyaudio.PyAudio()