mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-29 18:46:59 +00:00
fix(discord): inherit AudioSource in VoiceMixer for vc.play() compatibility
VoiceMixer duck-typed the discord.AudioSource interface (is_opus, read, cleanup) but never inherited from it. discord.py's vc.play() does an isinstance check and rejects non-AudioSource objects, causing the voice fx mixer to silently fail with: "Voice mixer failed to start: source must be an AudioSource not VoiceMixer" Added missing `import discord` and changed the class definition from `class VoiceMixer:` to `class VoiceMixer(discord.AudioSource):`.
This commit is contained in:
parent
31301c1af7
commit
eef1ab72d5
1 changed files with 3 additions and 1 deletions
|
|
@ -46,6 +46,8 @@ import logging
|
|||
import threading
|
||||
from typing import TYPE_CHECKING, List, Optional
|
||||
|
||||
import discord
|
||||
|
||||
if TYPE_CHECKING: # numpy is an optional ("voice" extra) dep — never import at runtime top-level
|
||||
import numpy as np
|
||||
|
||||
|
|
@ -145,7 +147,7 @@ class MixerChild:
|
|||
return samples
|
||||
|
||||
|
||||
class VoiceMixer:
|
||||
class VoiceMixer(discord.AudioSource):
|
||||
"""A continuous ``discord.AudioSource`` that mixes N child streams.
|
||||
|
||||
Use :meth:`set_ambient` to install/replace the looping idle bed and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue