Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Update WW upload
Browse files Browse the repository at this point in the history
Continuation of #48
Closes #47
  • Loading branch information
NeonDaniel committed Oct 12, 2023
1 parent 7df9c16 commit 13b7742
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ovos_backend_client/backends/personal.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,13 @@ def device_upload_wake_word_v1(self, audio, params, upload_url=None):
if not upload_url:
config = Configuration().get("listener", {}).get("wake_word_upload", {})
upload_url = config.get("url") or f"{self.backend_url}/precise/upload"
if not isinstance(audio, bytes):
byte_data = audio.get_wav_data()
else:
byte_data = audio

ww_files = {
'audio': BytesIO(audio.get_wav_data()),
'audio': BytesIO(byte_data),
'metadata': StringIO(json.dumps(params))
}
return self.post(upload_url, files=ww_files)
Expand Down

0 comments on commit 13b7742

Please sign in to comment.