diff --git a/voice_manager.py b/voice_manager.py index 259a241..438f2b6 100644 --- a/voice_manager.py +++ b/voice_manager.py @@ -195,12 +195,15 @@ class VoiceManager: # Effects management methods - def get_user_effects(self, user_id: int) -> dict[str, Any]: + def get_user_effects(self, user_id: int) -> dict[str, int | float]: """Get the audio effects for a user. Returns defaults if not set.""" effects = self._user_effects.get(user_id, {}) + # Convert to proper types (JSON stores them as strings) + pitch = effects.get("pitch", AudioEffects.PITCH_DEFAULT) + speed = effects.get("speed", AudioEffects.SPEED_DEFAULT) return { - "pitch": effects.get("pitch", AudioEffects.PITCH_DEFAULT), - "speed": effects.get("speed", AudioEffects.SPEED_DEFAULT), + "pitch": int(pitch) if pitch is not None else AudioEffects.PITCH_DEFAULT, + "speed": float(speed) if speed is not None else AudioEffects.SPEED_DEFAULT, } def set_user_effect(self, user_id: int, effect_name: str, value: Any) -> tuple[bool, str]: