diff options
| author | salmonik <raisersoft@proton.me> | 2026-05-20 15:40:18 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-05-20 15:40:18 +0200 |
| commit | 4663f260b55de0975661fda1c00f60d2ca6e4506 (patch) | |
| tree | b649850859595542f8e7916a5513e0840e911318 /cogs/vclogs.py | |
| parent | Fix TTS and AI voice playback bugs (diff) | |
| download | senator-sperma-4663f260b55de0975661fda1c00f60d2ca6e4506.tar.gz senator-sperma-4663f260b55de0975661fda1c00f60d2ca6e4506.zip | |
Clean up consumers: replace polling with VoiceManager.play_source()
- cron.py: replace while-is_playing polling with VoiceManager.play_source()
- vclogs.py: replace while-is_playing polling with VoiceManager.play_source()
- stop.py: use VoiceManager.disconnect() instead of raw voice_client
- join.py: use VoiceManager.connect() instead of raw channel.connect()
- voice.py: add back join_by_channel_id() convenience method
- Tests: update for new VoiceManager method names and signatures
Diffstat (limited to 'cogs/vclogs.py')
| -rw-r--r-- | cogs/vclogs.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/cogs/vclogs.py b/cogs/vclogs.py index b538265..2e853ad 100644 --- a/cogs/vclogs.py +++ b/cogs/vclogs.py | |||
| @@ -160,12 +160,7 @@ class VcLogs(commands.Cog): | |||
| 160 | 160 | ||
| 161 | logger.info("preparing to play audio") | 161 | logger.info("preparing to play audio") |
| 162 | audio_source = discord.FFmpegPCMAudio(tts_file) | 162 | audio_source = discord.FFmpegPCMAudio(tts_file) |
| 163 | if volume != 1.0: | 163 | await voice_mgr.play_source(channel, audio_source, volume=volume) |
| 164 | audio_source = discord.PCMVolumeTransformer(audio_source) | ||
| 165 | audio_source.volume = volume | ||
| 166 | voice_client.play(audio_source) | ||
| 167 | while voice_client.is_playing(): | ||
| 168 | await asyncio.sleep(0.1) | ||
| 169 | except Exception as e: | 164 | except Exception as e: |
| 170 | logger.error(f"TTS playback error: {e}") | 165 | logger.error(f"TTS playback error: {e}") |
| 171 | finally: | 166 | finally: |
