diff --git a/whisper.py b/whisper.py index 46838b9..9bb23a5 100644 --- a/whisper.py +++ b/whisper.py @@ -16,13 +16,14 @@ def audio_callback_closure(client: AsyncClient): #with open("/tmp/audiofile",'bw') as file: # file.write(audio.body) print("Transcribe audio") - response = requests.post('http://127.0.0.1:9000/asr?encode=true&task=transcribe&word_timestamps=false&output=txt', files=files) + response = requests.post('http://127.0.0.1:9000/asr?encode=true&language=de&task=transcribe&word_timestamps=false&output=txt', files=files) print("Finished transcribing") room_id = room.room_id + body = f"{room.user_name(event.sender)}: {event.body} \n{response.content.decode()}" await client.room_send( room_id=room_id, message_type="m.room.message", - content={"msgtype": "m.text", "body": response.content.decode()}, + content={"msgtype": "m.text", "body": body}, ) return audio_callback