mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-17 15:22:10 +00:00
work
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
import assemblyai as aai
|
import assemblyai as aai
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands, voice_recv
|
from discord.ext import commands, voice_recv
|
||||||
|
import logging
|
||||||
# Replace with your API key
|
# Replace with your API key
|
||||||
aai.settings.api_key = "aa9962f0088a449a9c4ab2361e96cc08"
|
aai.settings.api_key = "aa9962f0088a449a9c4ab2361e96cc08"
|
||||||
discord.opus._load_default()
|
discord.opus._load_default()
|
||||||
@@ -17,7 +18,7 @@ FILE_URL = "https://github.com/AssemblyAI-Community/audio-examples/raw/main/2023
|
|||||||
# You can also transcribe a local file by passing in a file path
|
# You can also transcribe a local file by passing in a file path
|
||||||
# FILE_URL = './path/to/file.mp3'
|
# FILE_URL = './path/to/file.mp3'
|
||||||
|
|
||||||
|
logger = logging.getLogger("discord")
|
||||||
|
|
||||||
class Transcriber(commands.Cog):
|
class Transcriber(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
@@ -61,8 +62,9 @@ class Transcriber(commands.Cog):
|
|||||||
# power = 127-(value & 127)
|
# power = 127-(value & 127)
|
||||||
# print('#' * int(power * (79/128)))
|
# print('#' * int(power * (79/128)))
|
||||||
## instead of 79 you can use shutil.get_terminal_size().columns-1
|
## instead of 79 you can use shutil.get_terminal_size().columns-1
|
||||||
|
logger.info("Attempt transcribe")
|
||||||
vc = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient)
|
vc = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient)
|
||||||
|
logger.info("Connected")
|
||||||
vc.listen(voice_recv.BasicSink(callback))
|
vc.listen(voice_recv.BasicSink(callback))
|
||||||
|
|
||||||
@commands.command(name="stop_transcribe")
|
@commands.command(name="stop_transcribe")
|
||||||
|
|||||||
Reference in New Issue
Block a user