mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-17 15:22:10 +00:00
11
This commit is contained in:
@@ -5,6 +5,7 @@ import assemblyai as aai
|
|||||||
import discord
|
import discord
|
||||||
from discord.ext import commands, voice_recv
|
from discord.ext import commands, voice_recv
|
||||||
from discord.opus import Decoder as OpusDecoder
|
from discord.opus import Decoder as OpusDecoder
|
||||||
|
from queue import Queue, Empty
|
||||||
|
|
||||||
# Replace with your API key
|
# Replace with your API key
|
||||||
aai.settings.api_key = "aa9962f0088a449a9c4ab2361e96cc08"
|
aai.settings.api_key = "aa9962f0088a449a9c4ab2361e96cc08"
|
||||||
@@ -126,6 +127,8 @@ class Transcriber(commands.Cog):
|
|||||||
self.bot = bot
|
self.bot = bot
|
||||||
self._last_member = None
|
self._last_member = None
|
||||||
self.wsink = SRBuffer(destination="/home/pi/Conjurer/wav.wav")
|
self.wsink = SRBuffer(destination="/home/pi/Conjurer/wav.wav")
|
||||||
|
self.threads = []
|
||||||
|
self.comm_queue = Queue()
|
||||||
|
|
||||||
async def transcribe(file_url):
|
async def transcribe(file_url):
|
||||||
config = aai.TranscriptionConfig(speaker_labels=True, language_code="pl")
|
config = aai.TranscriptionConfig(speaker_labels=True, language_code="pl")
|
||||||
@@ -138,7 +141,11 @@ class Transcriber(commands.Cog):
|
|||||||
@commands.hybrid_command(name="transcribe")
|
@commands.hybrid_command(name="transcribe")
|
||||||
async def test(self, ctx):
|
async def test(self, ctx):
|
||||||
logger.info("Attempt transcribe")
|
logger.info("Attempt transcribe")
|
||||||
vc = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient)
|
if ctx.client.voice_clients:
|
||||||
|
voice_client = ctx.client.voice_clients[0]
|
||||||
|
if not voice_client.is_connected():
|
||||||
|
logger.info("Connecting to voice")
|
||||||
|
vc = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient)
|
||||||
logger.info("Connected")
|
logger.info("Connected")
|
||||||
vc.listen(self.wsink)
|
vc.listen(self.wsink)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user