mirror of
https://github.com/correl/dejavu.git
synced 2024-11-23 19:19:53 +00:00
Moved mic recording constants inside MicrophoneRecognizer
This commit is contained in:
parent
788b3acebf
commit
614ad0d4cc
1 changed files with 5 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue