Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Commit 524a74e

Browse files
authored
Merge pull request #2661 from MycroftAI/disable-ww-upload
Disable wake word upload for v20.2
2 parents 67bb8e4 + 5dac7fe commit 524a74e

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

mycroft/client/speech/mic.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -534,27 +534,23 @@ def _compile_metadata(self):
534534
'model': str(model_hash)
535535
}
536536

537-
def _upload_wake_word(self, audio, metadata):
538-
requests.post(
539-
self.upload_url, files={
540-
'audio': BytesIO(audio.get_wav_data()),
541-
'metadata': StringIO(json.dumps(metadata))
542-
}
543-
)
544-
545537
def trigger_listen(self):
546538
"""Externally trigger listening."""
547539
LOG.debug('Listen triggered from external source.')
548540
self._listen_triggered = True
549541

550542
def _upload_wakeword(self, audio, metadata):
551543
"""Upload the wakeword in a background thread."""
552-
def upload(audio, metadata):
553-
requests.post(self.upload_url,
554-
files={'audio': BytesIO(audio.get_wav_data()),
555-
'metadata': StringIO(json.dumps(metadata))})
556-
557-
Thread(target=upload, daemon=True, args=(audio, metadata)).start()
544+
LOG.debug(
545+
"Wakeword uploading has been disabled. The API endpoint used in "
546+
"Mycroft-core v20.2 and below has been deprecated. To contribute "
547+
"new wakeword samples please upgrade to v20.8 or above."
548+
)
549+
# def upload(audio, metadata):
550+
# requests.post(self.upload_url,
551+
# files={'audio': BytesIO(audio.get_wav_data()),
552+
# 'metadata': StringIO(json.dumps(metadata))})
553+
# Thread(target=upload, daemon=True, args=(audio, metadata)).start()
558554

559555
def _send_wakeword_info(self, emitter):
560556
"""Send messagebus message indicating that a wakeword was received.

0 commit comments

Comments
 (0)