feat: add 4 new voice effects (echo, robot, chorus, tremolo)
- Removed MAX_ACTIVE_EFFECTS limit (effects unlimited) - Added echo effect (0-100%): spatial delay/reverb - Added robot effect (0-100%): ring modulation voice - Added chorus effect (0-100%): multiple voices effect - Added tremolo depth (0.0-1.0) and rate (0.0-10.0 Hz): amplitude modulation - Effects apply in order: pitch → speed → echo → chorus → tremolo → robot - Updated /effects command with all 7 effect choices - Updated /effects list to display all 7 effects with emojis - Updated warning system: warns when > 2 active effects - Added validation and formatting for all new effects - Updated voice_manager.py to handle all 7 effect storage/loading Note: Cancel button for processing >10s not yet implemented Note: Queue system needs updating to handle all effect parameters
This commit is contained in:
43
bot.py
43
bot.py
@@ -141,6 +141,11 @@ class TTSBot(commands.Bot):
|
||||
@app_commands.choices(effect_name=[
|
||||
app_commands.Choice(name="pitch", value="pitch"),
|
||||
app_commands.Choice(name="speed", value="speed"),
|
||||
app_commands.Choice(name="echo", value="echo"),
|
||||
app_commands.Choice(name="robot", value="robot"),
|
||||
app_commands.Choice(name="chorus", value="chorus"),
|
||||
app_commands.Choice(name="tremolo_depth", value="tremolo_depth"),
|
||||
app_commands.Choice(name="tremolo_rate", value="tremolo_rate"),
|
||||
])
|
||||
async def effects_command(
|
||||
interaction: discord.Interaction,
|
||||
@@ -174,12 +179,42 @@ class TTSBot(commands.Bot):
|
||||
lines.append(f"⚡ **Speed**: {speed_val}")
|
||||
lines.append(f" {speed_desc}\n")
|
||||
|
||||
# Echo
|
||||
echo_desc = AudioEffects.get_effect_description("echo")
|
||||
echo_val = AudioEffects.format_effect_value("echo", effects["echo"])
|
||||
lines.append(f"🔊 **Echo**: {echo_val}")
|
||||
lines.append(f" {echo_desc}\n")
|
||||
|
||||
# Robot
|
||||
robot_desc = AudioEffects.get_effect_description("robot")
|
||||
robot_val = AudioEffects.format_effect_value("robot", effects["robot"])
|
||||
lines.append(f"🤖 **Robot**: {robot_val}")
|
||||
lines.append(f" {robot_desc}\n")
|
||||
|
||||
# Chorus
|
||||
chorus_desc = AudioEffects.get_effect_description("chorus")
|
||||
chorus_val = AudioEffects.format_effect_value("chorus", effects["chorus"])
|
||||
lines.append(f"🎶 **Chorus**: {chorus_val}")
|
||||
lines.append(f" {chorus_desc}\n")
|
||||
|
||||
# Tremolo Depth
|
||||
tremolo_depth_desc = AudioEffects.get_effect_description("tremolo_depth")
|
||||
tremolo_depth_val = AudioEffects.format_effect_value("tremolo_depth", effects["tremolo_depth"])
|
||||
lines.append(f"〰️ **Tremolo Depth**: {tremolo_depth_val}")
|
||||
lines.append(f" {tremolo_depth_desc}\n")
|
||||
|
||||
# Tremolo Rate
|
||||
tremolo_rate_desc = AudioEffects.get_effect_description("tremolo_rate")
|
||||
tremolo_rate_val = AudioEffects.format_effect_value("tremolo_rate", effects["tremolo_rate"])
|
||||
lines.append(f"📳 **Tremolo Rate**: {tremolo_rate_val}")
|
||||
lines.append(f" {tremolo_rate_desc}\n")
|
||||
|
||||
# Active count warning
|
||||
lines.append(f"**Active Effects**: {active_count}/{AudioEffects.MAX_ACTIVE_EFFECTS}")
|
||||
if active_count >= AudioEffects.MAX_ACTIVE_EFFECTS:
|
||||
lines.append("⚠️ Max effects reached. More effects = slower processing time.")
|
||||
lines.append(f"**Active Effects**: {active_count}")
|
||||
if active_count > 2:
|
||||
lines.append("⚠️ You have more than 2 active effects. Processing may be slower!")
|
||||
elif active_count > 0:
|
||||
lines.append(f"ℹ️ You can add {AudioEffects.MAX_ACTIVE_EFFECTS - active_count} more effect(s).")
|
||||
lines.append("ℹ️ Add more effects for fun variations (may slow processing)")
|
||||
|
||||
lines.append(f"\n*Use `/effects set <effect> <value>` to change settings*")
|
||||
lines.append(f"*Use `/effects reset` to clear all effects*")
|
||||
|
||||
Reference in New Issue
Block a user