From a43233c7c6296f85ec2bf35624ad52f23394eeec Mon Sep 17 00:00:00 2001 From: insert-usernamehere Date: Sat, 15 Apr 2023 10:07:00 -0400 Subject: [PATCH] use oggs instead --- transcribebot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transcribebot.py b/transcribebot.py index e5a5222..9a65329 100644 --- a/transcribebot.py +++ b/transcribebot.py @@ -13,14 +13,14 @@ bot = commands.Bot(command_prefix='.') @bot.message_command(name="Transcrible") async def transcribe(inter: disnake.ApplicationCommandInteraction, message: disnake.Message): # Reversing the message and sending it back. - await message.attachments[0].save("audio.mp3") - mp3file = AudioSegment.from_mp3("audio.mp3") + await message.attachments[0].save("audio.ogg") + mp3file = AudioSegment.from_ogg("audio.ogg") mp3file.export("audio.wav", format="wav") convertemessage = sr.AudioFile("audio.wav") with convertemessage as sounds: transcribeaudo = st.record(sounds) await inter.response.send_message(st.recognize_sphinx(transcribeaudo), file=disnake.File("audio.mp3")) - os.remove("audio.mp3") + os.remove("audio.ogg") os.remove("audio.wav") bot.run(os.getenv("TOKEN")) \ No newline at end of file