mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-16 06:42:10 +00:00
fgf
This commit is contained in:
+13
-17
@@ -36,22 +36,6 @@ logger = logging.getLogger("discord")
|
|||||||
location = "/home/pi/Conjurer/"
|
location = "/home/pi/Conjurer/"
|
||||||
|
|
||||||
|
|
||||||
class Events(commands.Cog):
|
|
||||||
def __init__(self, bot):
|
|
||||||
self.bot = bot
|
|
||||||
|
|
||||||
@commands.Cog.listener()
|
|
||||||
async def on_voice_state_update(self, user, before, after):
|
|
||||||
if before.channel is None:
|
|
||||||
logger.info("User %s connected to channel %s", user, after.channel.name)
|
|
||||||
elif after.channel is None:
|
|
||||||
logger.info("User %s disconnected from channel %s", user, before.channel.name)
|
|
||||||
else:
|
|
||||||
logger.info("User VC status changed %s", user)
|
|
||||||
logger.info("Before %s", before)
|
|
||||||
logger.info("After %s", after)
|
|
||||||
|
|
||||||
|
|
||||||
class WaveWriter:
|
class WaveWriter:
|
||||||
def __init__(self, user_id):
|
def __init__(self, user_id):
|
||||||
|
|
||||||
@@ -94,6 +78,7 @@ class WaveWriter:
|
|||||||
# send present to transcription
|
# send present to transcription
|
||||||
|
|
||||||
def writeframes(self, pcmdata):
|
def writeframes(self, pcmdata):
|
||||||
|
logger.info(self.transcript_file_present)
|
||||||
self.transcript_file_present.writeframes(pcmdata)
|
self.transcript_file_present.writeframes(pcmdata)
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
@@ -170,6 +155,18 @@ class Transcriber(commands.Cog):
|
|||||||
logger.info(self.bot.voice_clients)
|
logger.info(self.bot.voice_clients)
|
||||||
vc.listen(self.wsink)
|
vc.listen(self.wsink)
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
|
async def on_voice_state_update(self, user, before, after):
|
||||||
|
if before.channel is None:
|
||||||
|
logger.info("User %s connected to channel %s", user, after.channel.name)
|
||||||
|
elif after.channel is None:
|
||||||
|
logger.info("User %s disconnected from channel %s", user, before.channel.name)
|
||||||
|
else:
|
||||||
|
logger.info("User VC status changed %s", user)
|
||||||
|
logger.info("Before %s", before)
|
||||||
|
logger.info("After %s", after)
|
||||||
|
|
||||||
|
|
||||||
@commands.command(name="stop_transcribe")
|
@commands.command(name="stop_transcribe")
|
||||||
async def stop(self, ctx):
|
async def stop(self, ctx):
|
||||||
await ctx.voice_client.disconnect()
|
await ctx.voice_client.disconnect()
|
||||||
@@ -177,7 +174,6 @@ class Transcriber(commands.Cog):
|
|||||||
|
|
||||||
async def setup(bot):
|
async def setup(bot):
|
||||||
await bot.add_cog(Transcriber(bot))
|
await bot.add_cog(Transcriber(bot))
|
||||||
await bot.add_cog(Events(bot))
|
|
||||||
|
|
||||||
|
|
||||||
# 1. zapisuj kwestie człowieka do pliku w którym będzie można stwierdzić kto co powiedział (callback z basicaudio + write z wavesinka). Zamykaj plik i wysyłaj do transkrypcji w momencie ciszy dłuższej niż 0.5s. Jeśli człowiek nadaje cały czas dawaj sygnał że nie można go transkrybować - i wyłaczaj zapis.
|
# 1. zapisuj kwestie człowieka do pliku w którym będzie można stwierdzić kto co powiedział (callback z basicaudio + write z wavesinka). Zamykaj plik i wysyłaj do transkrypcji w momencie ciszy dłuższej niż 0.5s. Jeśli człowiek nadaje cały czas dawaj sygnał że nie można go transkrybować - i wyłaczaj zapis.
|
||||||
|
|||||||
Reference in New Issue
Block a user