# Path: src/alexapi/triggers/voicetrigger.py
# class VoiceTrigger(BaseTrigger):
# 	__metaclass__ = ABCMeta
# 
# 	type = triggers.TYPES.VOICE
# 
# 	_detector = None
# 
# 	_enabled_lock = None
# 	_disabled_sync_lock = None
# 
# 	def __init__(self, config, trigger_callback):
# 
# 		super(VoiceTrigger, self).__init__(config, trigger_callback)
# 
# 		self._enabled_lock = threading.Event()
# 		self._disabled_sync_lock = threading.Event()
# 
# 	@abstractmethod
# 	def thread(self):
# 		pass
# 
# 	def run(self):
# 		thread = threading.Thread(target=self.thread, args=())
# 		thread.setDaemon(True)
# 		thread.start()
# 
# 	def enable(self):
# 		self._enabled_lock.set()
# 		self._disabled_sync_lock.clear()
# 
# 	def disable(self):
# 		self._enabled_lock.clear()
# 		self._disabled_sync_lock.wait()


import os
import logging
import time
import collections
import site
import pyaudio
from snowboy import snowboydetect  # pylint: disable=import-error
from .voicetrigger import VoiceTrigger
from ..capture import DeviceInfo
from ..exceptions import ConfigurationException



SNOWBOY_FOLDER = ''
try:
	for packages_path in site.getsitepackages():  # pylint: disable=no-member
		path_candidate = os.path.join(packages_path, 'snowboy')
		if os.path.exists(path_candidate):
			SNOWBOY_FOLDER = path_candidate

# Path: src/alexapi/triggers/voicetrigger.py
# class VoiceTrigger(BaseTrigger):
# 	__metaclass__ = ABCMeta
# 
# 	type = triggers.TYPES.VOICE
# 
# 	_detector = None
# 
# 	_enabled_lock = None
# 	_disabled_sync_lock = None
# 
# 	def __init__(self, config, trigger_callback):
# 
# 		super(VoiceTrigger, self).__init__(config, trigger_callback)
# 
# 		self._enabled_lock = threading.Event()
# 		self._disabled_sync_lock = threading.Event()
# 
# 	@abstractmethod
# 	def thread(self):
# 		pass
# 
# 	def run(self):
# 		thread = threading.Thread(target=self.thread, args=())
# 		thread.setDaemon(True)
# 		thread.start()
# 
# 	def enable(self):
# 		self._enabled_lock.set()
# 		self._disabled_sync_lock.clear()
# 
# 	def disable(self):
# 		self._enabled_lock.clear()
# 		self._disabled_sync_lock.wait()


# Path: src/alexapi/triggers/snowboytrigger.py
import os
import logging
import time
import collections
import site
import pyaudio
from snowboy import snowboydetect  # pylint: disable=import-error
from .voicetrigger import VoiceTrigger
from ..capture import DeviceInfo
from ..exceptions import ConfigurationException




SNOWBOY_FOLDER = ''
try:
	for packages_path in site.getsitepackages():  # pylint: disable=no-member
		path_candidate = os.path.join(packages_path, 'snowboy')
		if os.path.exists(path_candidate):
			SNOWBOY_FOLDER = path_candidate

except AttributeError: