snowboydetect.py 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # This file was automatically generated by SWIG (http://www.swig.org).
  2. # Version 3.0.8
  3. #
  4. # Do not make changes to this file unless you know what you are doing--modify
  5. # the SWIG interface file instead.
  6. from sys import version_info
  7. if version_info >= (2, 6, 0):
  8. def swig_import_helper():
  9. from os.path import dirname
  10. import imp
  11. fp = None
  12. try:
  13. fp, pathname, description = imp.find_module('_snowboydetect', [dirname(__file__)])
  14. except ImportError:
  15. import _snowboydetect
  16. return _snowboydetect
  17. if fp is not None:
  18. try:
  19. _mod = imp.load_module('_snowboydetect', fp, pathname, description)
  20. finally:
  21. fp.close()
  22. return _mod
  23. _snowboydetect = swig_import_helper()
  24. del swig_import_helper
  25. else:
  26. import _snowboydetect
  27. del version_info
  28. try:
  29. _swig_property = property
  30. except NameError:
  31. pass # Python < 2.2 doesn't have 'property'.
  32. def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
  33. if (name == "thisown"):
  34. return self.this.own(value)
  35. if (name == "this"):
  36. if type(value).__name__ == 'SwigPyObject':
  37. self.__dict__[name] = value
  38. return
  39. method = class_type.__swig_setmethods__.get(name, None)
  40. if method:
  41. return method(self, value)
  42. if (not static):
  43. if _newclass:
  44. object.__setattr__(self, name, value)
  45. else:
  46. self.__dict__[name] = value
  47. else:
  48. raise AttributeError("You cannot add attributes to %s" % self)
  49. def _swig_setattr(self, class_type, name, value):
  50. return _swig_setattr_nondynamic(self, class_type, name, value, 0)
  51. def _swig_getattr_nondynamic(self, class_type, name, static=1):
  52. if (name == "thisown"):
  53. return self.this.own()
  54. method = class_type.__swig_getmethods__.get(name, None)
  55. if method:
  56. return method(self)
  57. if (not static):
  58. return object.__getattr__(self, name)
  59. else:
  60. raise AttributeError(name)
  61. def _swig_getattr(self, class_type, name):
  62. return _swig_getattr_nondynamic(self, class_type, name, 0)
  63. def _swig_repr(self):
  64. try:
  65. strthis = "proxy of " + self.this.__repr__()
  66. except Exception:
  67. strthis = ""
  68. return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
  69. try:
  70. _object = object
  71. _newclass = 1
  72. except AttributeError:
  73. class _object:
  74. pass
  75. _newclass = 0
  76. class SnowboyDetect(_object):
  77. __swig_setmethods__ = {}
  78. __setattr__ = lambda self, name, value: _swig_setattr(self, SnowboyDetect, name, value)
  79. __swig_getmethods__ = {}
  80. __getattr__ = lambda self, name: _swig_getattr(self, SnowboyDetect, name)
  81. __repr__ = _swig_repr
  82. def __init__(self, resource_filename, model_str):
  83. this = _snowboydetect.new_SnowboyDetect(resource_filename, model_str)
  84. try:
  85. self.this.append(this)
  86. except Exception:
  87. self.this = this
  88. def Reset(self):
  89. return _snowboydetect.SnowboyDetect_Reset(self)
  90. def RunDetection(self, *args):
  91. return _snowboydetect.SnowboyDetect_RunDetection(self, *args)
  92. def SetSensitivity(self, sensitivity_str):
  93. return _snowboydetect.SnowboyDetect_SetSensitivity(self, sensitivity_str)
  94. def GetSensitivity(self):
  95. return _snowboydetect.SnowboyDetect_GetSensitivity(self)
  96. def SetAudioGain(self, audio_gain):
  97. return _snowboydetect.SnowboyDetect_SetAudioGain(self, audio_gain)
  98. def UpdateModel(self):
  99. return _snowboydetect.SnowboyDetect_UpdateModel(self)
  100. def NumHotwords(self):
  101. return _snowboydetect.SnowboyDetect_NumHotwords(self)
  102. def SampleRate(self):
  103. return _snowboydetect.SnowboyDetect_SampleRate(self)
  104. def NumChannels(self):
  105. return _snowboydetect.SnowboyDetect_NumChannels(self)
  106. def BitsPerSample(self):
  107. return _snowboydetect.SnowboyDetect_BitsPerSample(self)
  108. __swig_destroy__ = _snowboydetect.delete_SnowboyDetect
  109. __del__ = lambda self: None
  110. SnowboyDetect_swigregister = _snowboydetect.SnowboyDetect_swigregister
  111. SnowboyDetect_swigregister(SnowboyDetect)
  112. # This file is compatible with both classic and new-style classes.