(self)
| 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 | |
| 184 | def reconnect(func, *default_args, **default_kwargs): |
no test coverage detected