Open gutbash opened 7 months ago
Not sue if this helps, if not I can show more of my code.
"class AudioSink"
class AudioSink(voice_recv.BasicSink):
def __init__(self, callback):
super().__init__(callback)
self.audio_data = []
self.speakers = defaultdict(int)
def write(self, user, data: voice_recv.VoiceData):
self.audio_data.append(data.pcm) # Extract raw audio data
self.speakers[str(user)] += 1 # Count how many times each user spoke
"class Recording"
def callback(user, data: voice_recv.VoiceData):
print(f"Got packet from {user}")
self.sink.write(user, data)
vc = await voice_channel.connect(cls=voice_recv.VoiceRecvClient)
self.sink = AudioSink(callback)
vc.listen(self.sink)
speaker_info = "\n".join([f"{user}: spoke {count} times" for user, count in self.sink.speakers.items()])
I hope that's everything you need.
why does receiving the
member
not work like in the read me?