feat: Add wants_opus method to VoiceAudioSink to indicate PCM audio processing

This commit is contained in:
Slipstream 2025-05-30 22:06:04 -06:00
parent 3824ba9a6c
commit 09a9ced39c
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -117,6 +117,13 @@ class VoiceAudioSink(voice_recv.AudioSink): # Inherit from voice_recv.AudioSink
if not webrtcvad:
print("VAD library not loaded. STT might be less efficient or not work as intended.")
def wants_opus(self) -> bool:
"""
Indicates whether the sink wants Opus-encoded audio (True) or PCM audio (False).
Our sink processes PCM data, so we return False.
"""
return False
# Signature changed: user object directly, data is raw 48kHz stereo PCM
def write(self, user: discord.User, pcm_data_48k_stereo: bytes):
if not webrtcvad or not self.voice_client or not user: # OpusDecoder check removed, user check added