MCPcopy Create free account
hub / github.com/jasperproject/jasper-client / handleForever

Method handleForever

client/modules/MPDControl.py:157–181  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

155 return
156
157 def handleForever(self):
158
159 self.music.play()
160 self.mic.say("Playing %s" % self.music.current_song())
161
162 while True:
163
164 threshold, transcribed = self.mic.passiveListen(self.persona)
165
166 if not transcribed or not threshold:
167 self._logger.info("Nothing has been said or transcribed.")
168 continue
169
170 self.music.pause()
171
172 input = self.mic.activeListen(MUSIC=True)
173
174 if input:
175 if "close" in input.lower():
176 self.mic.say("Closing Spotify")
177 return
178 self.delegateInput(input)
179 else:
180 self.mic.say("Pardon?")
181 self.music.play()
182
183
184def reconnect(func, *default_args, **default_kwargs):

Callers 1

handleFunction · 0.95

Calls 7

delegateInputMethod · 0.95
current_songMethod · 0.80
pauseMethod · 0.80
playMethod · 0.45
sayMethod · 0.45
passiveListenMethod · 0.45
activeListenMethod · 0.45

Tested by

no test coverage detected