feat(triggers): Add sound modifiers for voicetriggers#111
Conversation
Remove logging of modifiers before playing audio clip.
There was a problem hiding this comment.
Pull request overview
This PR adds the ability to pass runtime audio modifiers (volume, speed, pitch) for voice triggers via inline chat arguments (e.g., !tuturu volume=0.5 pitch=1.2). It restructures the audio parameter configuration from flat top-level keys in VoiceServer to a nested AudioParams object with per-parameter Default, Min, and Max bounds, and introduces a new parse_params method in AudioManager to merge trigger-defined parameters with user-supplied overrides.
Changes:
- Added
parse_paramstoAudioManagerto read and clamp user-supplied audio modifiers from the chat message. - Updated
VoiceTrigger._funcinCommands.pyto extract the trigger number from the first word ofmessage[1]and pass the full message toparse_paramsfor modifier parsing. - Restructured
config.json'sVoiceServersection, replacing flatVolume/Speed/Pitchkeys with anAudioParamsobject containingDefault,Min, andMaxfor each parameter.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/torchlight/AudioManager.py |
Adds parse_params method to resolve audio params from trigger config and chat message modifiers |
src/torchlight/Commands.py |
Updates VoiceTrigger._func to parse trigger number from the first token of the args and pass all args to parse_params |
config/config.json |
Restructures VoiceServer audio params into an AudioParams sub-object with bounds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.