snowboydetect.py 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. # This file was automatically generated by SWIG (http://www.swig.org).
  2. # Version 3.0.12
  3. #
  4. # Do not make changes to this file unless you know what you are doing--modify
  5. # the SWIG interface file instead.
  6. import _snowboydetect
  7. from sys import version_info as _swig_python_version_info
  8. if _swig_python_version_info >= (2, 7, 0):
  9. def swig_import_helper():
  10. import importlib
  11. pkg = __name__.rpartition('.')[0]
  12. mname = '.'.join((pkg, '_snowboydetect')).lstrip('.')
  13. try:
  14. return importlib.import_module(mname)
  15. except ImportError:
  16. return importlib.import_module('_snowboydetect')
  17. _snowboydetect = swig_import_helper()
  18. del swig_import_helper
  19. elif _swig_python_version_info >= (2, 6, 0):
  20. def swig_import_helper():
  21. from os.path import dirname
  22. import imp
  23. fp = None
  24. try:
  25. fp, pathname, description = imp.find_module('_snowboydetect', [dirname(__file__)])
  26. except ImportError:
  27. import _snowboydetect
  28. return _snowboydetect
  29. try:
  30. _mod = imp.load_module('_snowboydetect', fp, pathname, description)
  31. finally:
  32. if fp is not None:
  33. fp.close()
  34. return _mod
  35. _snowboydetect = swig_import_helper()
  36. del swig_import_helper
  37. else:
  38. import _snowboydetect
  39. del _swig_python_version_info
  40. try:
  41. _swig_property = property
  42. except NameError:
  43. pass # Python < 2.2 doesn't have 'property'.
  44. try:
  45. import builtins as __builtin__
  46. except ImportError:
  47. import __builtin__
  48. def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
  49. if (name == "thisown"):
  50. return self.this.own(value)
  51. if (name == "this"):
  52. if type(value).__name__ == 'SwigPyObject':
  53. self.__dict__[name] = value
  54. return
  55. method = class_type.__swig_setmethods__.get(name, None)
  56. if method:
  57. return method(self, value)
  58. if (not static):
  59. if _newclass:
  60. object.__setattr__(self, name, value)
  61. else:
  62. self.__dict__[name] = value
  63. else:
  64. raise AttributeError("You cannot add attributes to %s" % self)
  65. def _swig_setattr(self, class_type, name, value):
  66. return _swig_setattr_nondynamic(self, class_type, name, value, 0)
  67. def _swig_getattr(self, class_type, name):
  68. if (name == "thisown"):
  69. return self.this.own()
  70. method = class_type.__swig_getmethods__.get(name, None)
  71. if method:
  72. return method(self)
  73. raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
  74. def _swig_repr(self):
  75. try:
  76. strthis = "proxy of " + self.this.__repr__()
  77. except __builtin__.Exception:
  78. strthis = ""
  79. return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
  80. try:
  81. _object = object
  82. _newclass = 1
  83. except __builtin__.Exception:
  84. class _object:
  85. pass
  86. _newclass = 0
  87. class SnowboyDetect(_object):
  88. __swig_setmethods__ = {}
  89. __setattr__ = lambda self, name, value: _swig_setattr(self, SnowboyDetect, name, value)
  90. __swig_getmethods__ = {}
  91. __getattr__ = lambda self, name: _swig_getattr(self, SnowboyDetect, name)
  92. __repr__ = _swig_repr
  93. def __init__(self, resource_filename, model_str):
  94. this = _snowboydetect.new_SnowboyDetect(resource_filename, model_str)
  95. try:
  96. self.this.append(this)
  97. except __builtin__.Exception:
  98. self.this = this
  99. def Reset(self):
  100. return _snowboydetect.SnowboyDetect_Reset(self)
  101. def RunDetection(self, *args):
  102. return _snowboydetect.SnowboyDetect_RunDetection(self, *args)
  103. def SetSensitivity(self, sensitivity_str):
  104. return _snowboydetect.SnowboyDetect_SetSensitivity(self, sensitivity_str)
  105. def SetHighSensitivity(self, high_sensitivity_str):
  106. return _snowboydetect.SnowboyDetect_SetHighSensitivity(self, high_sensitivity_str)
  107. def GetSensitivity(self):
  108. return _snowboydetect.SnowboyDetect_GetSensitivity(self)
  109. def SetAudioGain(self, audio_gain):
  110. return _snowboydetect.SnowboyDetect_SetAudioGain(self, audio_gain)
  111. def UpdateModel(self):
  112. return _snowboydetect.SnowboyDetect_UpdateModel(self)
  113. def NumHotwords(self):
  114. return _snowboydetect.SnowboyDetect_NumHotwords(self)
  115. def ApplyFrontend(self, apply_frontend):
  116. return _snowboydetect.SnowboyDetect_ApplyFrontend(self, apply_frontend)
  117. def SampleRate(self):
  118. return _snowboydetect.SnowboyDetect_SampleRate(self)
  119. def NumChannels(self):
  120. return _snowboydetect.SnowboyDetect_NumChannels(self)
  121. def BitsPerSample(self):
  122. return _snowboydetect.SnowboyDetect_BitsPerSample(self)
  123. __swig_destroy__ = _snowboydetect.delete_SnowboyDetect
  124. __del__ = lambda self: None
  125. SnowboyDetect_swigregister = _snowboydetect.SnowboyDetect_swigregister
  126. SnowboyDetect_swigregister(SnowboyDetect)
  127. class SnowboyVad(_object):
  128. __swig_setmethods__ = {}
  129. __setattr__ = lambda self, name, value: _swig_setattr(self, SnowboyVad, name, value)
  130. __swig_getmethods__ = {}
  131. __getattr__ = lambda self, name: _swig_getattr(self, SnowboyVad, name)
  132. __repr__ = _swig_repr
  133. def __init__(self, resource_filename):
  134. this = _snowboydetect.new_SnowboyVad(resource_filename)
  135. try:
  136. self.this.append(this)
  137. except __builtin__.Exception:
  138. self.this = this
  139. def Reset(self):
  140. return _snowboydetect.SnowboyVad_Reset(self)
  141. def RunVad(self, *args):
  142. return _snowboydetect.SnowboyVad_RunVad(self, *args)
  143. def SetAudioGain(self, audio_gain):
  144. return _snowboydetect.SnowboyVad_SetAudioGain(self, audio_gain)
  145. def ApplyFrontend(self, apply_frontend):
  146. return _snowboydetect.SnowboyVad_ApplyFrontend(self, apply_frontend)
  147. def SampleRate(self):
  148. return _snowboydetect.SnowboyVad_SampleRate(self)
  149. def NumChannels(self):
  150. return _snowboydetect.SnowboyVad_NumChannels(self)
  151. def BitsPerSample(self):
  152. return _snowboydetect.SnowboyVad_BitsPerSample(self)
  153. __swig_destroy__ = _snowboydetect.delete_SnowboyVad
  154. __del__ = lambda self: None
  155. SnowboyVad_swigregister = _snowboydetect.SnowboyVad_swigregister
  156. SnowboyVad_swigregister(SnowboyVad)
  157. # This file is compatible with both classic and new-style classes.