Kitt-AI / snowboy

Future versions with model training module will be maintained through a forked version here: https://github.com/seasalt-ai/snowboy
Other
3.11k stars 1k forks source link

how do i change rate, channels, frames_per_buffer in the demo #682

Open Vricken opened 4 years ago

Vricken commented 4 years ago

How do I change rate, channels, frames_per_buffer in the demo in the variable detector? I am trying to do this since if the values are not equal in the code being activated and this one it will throw me this error ||PaMacCore (AUHAL)|| Error on line 2490: err='-10863', msg=Audio Unit: cannot do in current context and from what i have understood from this issue #123 the two need to be the same

import snowboydecoder
import signal
import ait2

interrupted = False

def signal_handler(signal, frame):
    global interrupted
    interrupted = True

def interrupt_callback():
    global interrupted
    return interrupted

signal.signal(signal.SIGINT, signal_handler)

detector = snowboydecoder.HotwordDetector("AiT.pmdl", sensitivity=0.5, audio_gain=1)
print('Listening... Press Ctrl+C to exit')
detector.start(detected_callback=ait2.run,
               interrupt_check=interrupt_callback,
               sleep_time=0.03)

detector.terminate()