agentvibes 5.2.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/config/audio-effects.cfg +1 -1
- package/.claude/hooks/audio-cache-utils.sh +246 -246
- package/.claude/hooks/background-music-manager.sh +404 -404
- package/.claude/hooks/bmad-speak-enhanced.sh +165 -165
- package/.claude/hooks/bmad-speak.sh +290 -290
- package/.claude/hooks/bmad-tts-injector.sh +568 -568
- package/.claude/hooks/bmad-voice-manager.sh +928 -928
- package/.claude/hooks/clawdbot-receiver-SECURE.sh +129 -129
- package/.claude/hooks/clawdbot-receiver.sh +107 -107
- package/.claude/hooks/clean-audio-cache.sh +22 -22
- package/.claude/hooks/cleanup-cache.sh +106 -106
- package/.claude/hooks/configure-rdp-mode.sh +137 -137
- package/.claude/hooks/download-extra-voices.sh +244 -244
- package/.claude/hooks/effects-manager.sh +268 -268
- package/.claude/hooks/github-star-reminder.sh +154 -154
- package/.claude/hooks/language-manager.sh +362 -362
- package/.claude/hooks/learn-manager.sh +492 -492
- package/.claude/hooks/macos-voice-manager.sh +205 -205
- package/.claude/hooks/migrate-background-music.sh +125 -125
- package/.claude/hooks/migrate-to-agentvibes.sh +161 -161
- package/.claude/hooks/optimize-background-music.sh +87 -87
- package/.claude/hooks/path-resolver.sh +60 -60
- package/.claude/hooks/personality-manager.sh +448 -448
- package/.claude/hooks/piper-installer.sh +292 -292
- package/.claude/hooks/piper-multispeaker-registry.sh +171 -171
- package/.claude/hooks/play-tts-enhanced.sh +105 -105
- package/.claude/hooks/play-tts-termux-ssh.sh +169 -169
- package/.claude/hooks/play-tts.sh +14 -5
- package/.claude/hooks/prepare-release.sh +54 -54
- package/.claude/hooks/provider-commands.sh +617 -617
- package/.claude/hooks/provider-manager.sh +399 -399
- package/.claude/hooks/replay-target-audio.sh +95 -95
- package/.claude/hooks/sentiment-manager.sh +201 -201
- package/.claude/hooks/speed-manager.sh +291 -291
- package/.claude/hooks/stop-tts.sh +84 -84
- package/.claude/hooks/termux-installer.sh +261 -261
- package/.claude/hooks/translate-manager.sh +341 -341
- package/.claude/hooks/tts-queue-worker.sh +145 -145
- package/.claude/hooks/tts-queue.sh +165 -165
- package/.claude/hooks/voice-manager.sh +552 -548
- package/.claude/hooks-windows/play-tts.ps1 +2 -2
- package/README.md +11 -2
- package/RELEASE_NOTES.md +38 -0
- package/bin/mcp-server.sh +206 -206
- package/mcp-server/server.py +35 -6
- package/package.json +1 -1
- package/src/console/tabs/setup-tab.js +59 -23
- package/src/installer.js +79 -213
- package/src/services/llm-provider-service.js +126 -75
|
@@ -1,268 +1,268 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# File: .claude/hooks/effects-manager.sh
|
|
4
|
-
#
|
|
5
|
-
# AgentVibes - Finally, your AI Agents can Talk Back! Text-to-Speech WITH personality for AI Assistants!
|
|
6
|
-
# Website: https://agentvibes.org
|
|
7
|
-
# Repository: https://github.com/paulpreibisch/AgentVibes
|
|
8
|
-
#
|
|
9
|
-
# Co-created by Paul Preibisch with Claude AI
|
|
10
|
-
# Copyright (c) 2025 Paul Preibisch
|
|
11
|
-
#
|
|
12
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
-
# you may not use this file except in compliance with the License.
|
|
14
|
-
# You may obtain a copy of the License at
|
|
15
|
-
#
|
|
16
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
#
|
|
18
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
19
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
-
# See the License for the specific language governing permissions and
|
|
22
|
-
# limitations under the License.
|
|
23
|
-
|
|
24
|
-
set -euo pipefail
|
|
25
|
-
|
|
26
|
-
# Get script directory and config file path
|
|
27
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
28
|
-
CONFIG_FILE="$SCRIPT_DIR/../config/audio-effects.cfg"
|
|
29
|
-
|
|
30
|
-
# Reverb level mappings (reverberance HF-damping room-scale)
|
|
31
|
-
declare -A REVERB_LEVELS=(
|
|
32
|
-
["off"]=""
|
|
33
|
-
["light"]="reverb 20 50 50"
|
|
34
|
-
["medium"]="reverb 40 50 70"
|
|
35
|
-
["heavy"]="reverb 70 50 100"
|
|
36
|
-
["cathedral"]="reverb 90 30 100"
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
# @function get_agent_effects
|
|
40
|
-
# @intent Get current effects configuration for an agent
|
|
41
|
-
# @param $1 Agent name (or "default")
|
|
42
|
-
# @returns Echoes the SOX effects string
|
|
43
|
-
get_agent_effects() {
|
|
44
|
-
local agent_name="$1"
|
|
45
|
-
|
|
46
|
-
if [[ ! -f "$CONFIG_FILE" ]]; then
|
|
47
|
-
echo ""
|
|
48
|
-
return
|
|
49
|
-
fi
|
|
50
|
-
|
|
51
|
-
# Read agent config line, format: AGENT_NAME|SOX_EFFECTS|BACKGROUND_FILE|BACKGROUND_VOLUME
|
|
52
|
-
local config_line=$(grep "^${agent_name}|" "$CONFIG_FILE" 2>/dev/null || echo "")
|
|
53
|
-
|
|
54
|
-
if [[ -z "$config_line" ]]; then
|
|
55
|
-
# Try default
|
|
56
|
-
config_line=$(grep "^default|" "$CONFIG_FILE" 2>/dev/null || echo "")
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
if [[ -n "$config_line" ]]; then
|
|
60
|
-
echo "$config_line" | cut -d'|' -f2
|
|
61
|
-
else
|
|
62
|
-
echo ""
|
|
63
|
-
fi
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
# @function set_reverb
|
|
67
|
-
# @intent Set reverb level for an agent or globally
|
|
68
|
-
# @param $1 Reverb level (off, light, medium, heavy, cathedral)
|
|
69
|
-
# @param $2 Agent name (optional, defaults to "default")
|
|
70
|
-
# @param $3 --all flag (optional, applies to all agents)
|
|
71
|
-
set_reverb() {
|
|
72
|
-
local level="$1"
|
|
73
|
-
local agent_name="${2:-default}"
|
|
74
|
-
local apply_all="${3:-}"
|
|
75
|
-
|
|
76
|
-
# Validate level
|
|
77
|
-
if [[ ! -v REVERB_LEVELS[$level] ]]; then
|
|
78
|
-
echo "❌ Invalid reverb level: $level"
|
|
79
|
-
echo "Valid levels: off, light, medium, heavy, cathedral"
|
|
80
|
-
return 1
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
|
-
local reverb_effect="${REVERB_LEVELS[$level]}"
|
|
84
|
-
|
|
85
|
-
if [[ "$apply_all" == "--all" ]]; then
|
|
86
|
-
# Apply to all agents in config
|
|
87
|
-
echo "🎛️ Setting reverb to '$level' for all agents..."
|
|
88
|
-
|
|
89
|
-
# Create temp file
|
|
90
|
-
local temp_file="${CONFIG_FILE}.tmp"
|
|
91
|
-
|
|
92
|
-
# Process each line
|
|
93
|
-
while IFS='|' read -r agent sox_effects bg_file bg_vol || [[ -n "$agent" ]]; do
|
|
94
|
-
# Skip comments and empty lines
|
|
95
|
-
if [[ "$agent" =~ ^# ]] || [[ -z "$agent" ]]; then
|
|
96
|
-
echo "$agent|$sox_effects|$bg_file|$bg_vol" >> "$temp_file"
|
|
97
|
-
continue
|
|
98
|
-
fi
|
|
99
|
-
|
|
100
|
-
# Remove existing reverb from sox effects
|
|
101
|
-
local new_effects=$(echo "$sox_effects" | sed -E 's/reverb [0-9]+ [0-9]+ [0-9]+//g' | sed 's/ */ /g' | sed 's/^ //;s/ $//')
|
|
102
|
-
|
|
103
|
-
# Add new reverb if not off
|
|
104
|
-
if [[ -n "$reverb_effect" ]]; then
|
|
105
|
-
if [[ -n "$new_effects" ]]; then
|
|
106
|
-
new_effects="$reverb_effect $new_effects"
|
|
107
|
-
else
|
|
108
|
-
new_effects="$reverb_effect"
|
|
109
|
-
fi
|
|
110
|
-
fi
|
|
111
|
-
|
|
112
|
-
echo "${agent}|${new_effects}|${bg_file}|${bg_vol}" >> "$temp_file"
|
|
113
|
-
done < "$CONFIG_FILE"
|
|
114
|
-
|
|
115
|
-
# Replace original with temp
|
|
116
|
-
mv "$temp_file" "$CONFIG_FILE"
|
|
117
|
-
|
|
118
|
-
echo "✅ Reverb set to '$level' for all agents"
|
|
119
|
-
else
|
|
120
|
-
# Apply to specific agent
|
|
121
|
-
echo "🎛️ Setting reverb to '$level' for '$agent_name'..."
|
|
122
|
-
|
|
123
|
-
# Check if agent exists in config
|
|
124
|
-
if ! grep -q "^${agent_name}|" "$CONFIG_FILE" 2>/dev/null; then
|
|
125
|
-
# Agent doesn't exist, add it with just reverb
|
|
126
|
-
echo "${agent_name}|${reverb_effect}|agentvibes_soft_flamenco_loop.mp3|0.30" >> "$CONFIG_FILE"
|
|
127
|
-
echo "✅ Created new config for '$agent_name' with reverb '$level'"
|
|
128
|
-
return
|
|
129
|
-
fi
|
|
130
|
-
|
|
131
|
-
# Create temp file
|
|
132
|
-
local temp_file="${CONFIG_FILE}.tmp"
|
|
133
|
-
|
|
134
|
-
# Process each line
|
|
135
|
-
while IFS='|' read -r agent sox_effects bg_file bg_vol || [[ -n "$agent" ]]; do
|
|
136
|
-
# Skip comments and empty lines
|
|
137
|
-
if [[ "$agent" =~ ^# ]] || [[ -z "$agent" ]]; then
|
|
138
|
-
echo "$agent|$sox_effects|$bg_file|$bg_vol" >> "$temp_file"
|
|
139
|
-
continue
|
|
140
|
-
fi
|
|
141
|
-
|
|
142
|
-
if [[ "$agent" == "$agent_name" ]]; then
|
|
143
|
-
# Remove existing reverb from sox effects
|
|
144
|
-
local new_effects=$(echo "$sox_effects" | sed -E 's/reverb [0-9]+ [0-9]+ [0-9]+//g' | sed 's/ */ /g' | sed 's/^ //;s/ $//')
|
|
145
|
-
|
|
146
|
-
# Add new reverb if not off
|
|
147
|
-
if [[ -n "$reverb_effect" ]]; then
|
|
148
|
-
if [[ -n "$new_effects" ]]; then
|
|
149
|
-
new_effects="$reverb_effect $new_effects"
|
|
150
|
-
else
|
|
151
|
-
new_effects="$reverb_effect"
|
|
152
|
-
fi
|
|
153
|
-
fi
|
|
154
|
-
|
|
155
|
-
echo "${agent}|${new_effects}|${bg_file}|${bg_vol}" >> "$temp_file"
|
|
156
|
-
else
|
|
157
|
-
echo "${agent}|${sox_effects}|${bg_file}|${bg_vol}" >> "$temp_file"
|
|
158
|
-
fi
|
|
159
|
-
done < "$CONFIG_FILE"
|
|
160
|
-
|
|
161
|
-
# Replace original with temp
|
|
162
|
-
mv "$temp_file" "$CONFIG_FILE"
|
|
163
|
-
|
|
164
|
-
echo "✅ Reverb set to '$level' for '$agent_name'"
|
|
165
|
-
fi
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
# @function list_effects
|
|
169
|
-
# @intent List current effects for all agents
|
|
170
|
-
list_effects() {
|
|
171
|
-
if [[ ! -f "$CONFIG_FILE" ]]; then
|
|
172
|
-
echo "❌ Config file not found: $CONFIG_FILE"
|
|
173
|
-
return 1
|
|
174
|
-
fi
|
|
175
|
-
|
|
176
|
-
echo "📊 Current Audio Effects Configuration:"
|
|
177
|
-
echo ""
|
|
178
|
-
|
|
179
|
-
while IFS='|' read -r agent sox_effects bg_file bg_vol || [[ -n "$agent" ]]; do
|
|
180
|
-
# Skip comments and empty lines
|
|
181
|
-
if [[ "$agent" =~ ^# ]] || [[ -z "$agent" ]]; then
|
|
182
|
-
continue
|
|
183
|
-
fi
|
|
184
|
-
|
|
185
|
-
# Extract reverb level if present
|
|
186
|
-
local reverb_level="off"
|
|
187
|
-
if [[ "$sox_effects" =~ reverb\ ([0-9]+)\ ([0-9]+)\ ([0-9]+) ]]; then
|
|
188
|
-
local reverb_val="${BASH_REMATCH[1]}"
|
|
189
|
-
if [[ "$reverb_val" -le 20 ]]; then
|
|
190
|
-
reverb_level="light"
|
|
191
|
-
elif [[ "$reverb_val" -le 40 ]]; then
|
|
192
|
-
reverb_level="medium"
|
|
193
|
-
elif [[ "$reverb_val" -le 70 ]]; then
|
|
194
|
-
reverb_level="heavy"
|
|
195
|
-
else
|
|
196
|
-
reverb_level="cathedral"
|
|
197
|
-
fi
|
|
198
|
-
fi
|
|
199
|
-
|
|
200
|
-
echo " $agent: reverb=$reverb_level"
|
|
201
|
-
if [[ -n "$sox_effects" ]]; then
|
|
202
|
-
echo " Effects: $sox_effects"
|
|
203
|
-
fi
|
|
204
|
-
done < "$CONFIG_FILE"
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
# @function get_reverb_level
|
|
208
|
-
# @intent Get current reverb level for an agent
|
|
209
|
-
# @param $1 Agent name (or "default")
|
|
210
|
-
# @returns Echoes reverb level name (off, light, medium, heavy, cathedral)
|
|
211
|
-
get_reverb_level() {
|
|
212
|
-
local agent_name="$1"
|
|
213
|
-
local effects=$(get_agent_effects "$agent_name")
|
|
214
|
-
|
|
215
|
-
if [[ -z "$effects" ]] || [[ ! "$effects" =~ reverb ]]; then
|
|
216
|
-
echo "off"
|
|
217
|
-
return
|
|
218
|
-
fi
|
|
219
|
-
|
|
220
|
-
# Extract reverb parameters
|
|
221
|
-
if [[ "$effects" =~ reverb\ ([0-9]+)\ ([0-9]+)\ ([0-9]+) ]]; then
|
|
222
|
-
local reverb_val="${BASH_REMATCH[1]}"
|
|
223
|
-
if [[ "$reverb_val" -le 20 ]]; then
|
|
224
|
-
echo "light"
|
|
225
|
-
elif [[ "$reverb_val" -le 40 ]]; then
|
|
226
|
-
echo "medium"
|
|
227
|
-
elif [[ "$reverb_val" -le 70 ]]; then
|
|
228
|
-
echo "heavy"
|
|
229
|
-
else
|
|
230
|
-
echo "cathedral"
|
|
231
|
-
fi
|
|
232
|
-
else
|
|
233
|
-
echo "off"
|
|
234
|
-
fi
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
# Main command dispatcher
|
|
238
|
-
case "${1:-help}" in
|
|
239
|
-
set-reverb)
|
|
240
|
-
if [[ -z "${2:-}" ]]; then
|
|
241
|
-
echo "Usage: effects-manager.sh set-reverb <level> [agent-name] [--all]"
|
|
242
|
-
echo "Levels: off, light, medium, heavy, cathedral"
|
|
243
|
-
exit 1
|
|
244
|
-
fi
|
|
245
|
-
set_reverb "$2" "${3:-default}" "${4:-}"
|
|
246
|
-
;;
|
|
247
|
-
get-reverb)
|
|
248
|
-
get_reverb_level "${2:-default}"
|
|
249
|
-
;;
|
|
250
|
-
get-effects)
|
|
251
|
-
get_agent_effects "${2:-default}"
|
|
252
|
-
;;
|
|
253
|
-
list)
|
|
254
|
-
list_effects
|
|
255
|
-
;;
|
|
256
|
-
*)
|
|
257
|
-
echo "Usage: effects-manager.sh {set-reverb|get-reverb|get-effects|list}"
|
|
258
|
-
echo ""
|
|
259
|
-
echo "Commands:"
|
|
260
|
-
echo " set-reverb <level> [agent] [--all] Set reverb level"
|
|
261
|
-
echo " get-reverb [agent] Get current reverb level"
|
|
262
|
-
echo " get-effects [agent] Get all effects for agent"
|
|
263
|
-
echo " list List all agent effects"
|
|
264
|
-
echo ""
|
|
265
|
-
echo "Reverb Levels: off, light, medium, heavy, cathedral"
|
|
266
|
-
exit 1
|
|
267
|
-
;;
|
|
268
|
-
esac
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# File: .claude/hooks/effects-manager.sh
|
|
4
|
+
#
|
|
5
|
+
# AgentVibes - Finally, your AI Agents can Talk Back! Text-to-Speech WITH personality for AI Assistants!
|
|
6
|
+
# Website: https://agentvibes.org
|
|
7
|
+
# Repository: https://github.com/paulpreibisch/AgentVibes
|
|
8
|
+
#
|
|
9
|
+
# Co-created by Paul Preibisch with Claude AI
|
|
10
|
+
# Copyright (c) 2025 Paul Preibisch
|
|
11
|
+
#
|
|
12
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
# you may not use this file except in compliance with the License.
|
|
14
|
+
# You may obtain a copy of the License at
|
|
15
|
+
#
|
|
16
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
#
|
|
18
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
# See the License for the specific language governing permissions and
|
|
22
|
+
# limitations under the License.
|
|
23
|
+
|
|
24
|
+
set -euo pipefail
|
|
25
|
+
|
|
26
|
+
# Get script directory and config file path
|
|
27
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
28
|
+
CONFIG_FILE="$SCRIPT_DIR/../config/audio-effects.cfg"
|
|
29
|
+
|
|
30
|
+
# Reverb level mappings (reverberance HF-damping room-scale)
|
|
31
|
+
declare -A REVERB_LEVELS=(
|
|
32
|
+
["off"]=""
|
|
33
|
+
["light"]="reverb 20 50 50"
|
|
34
|
+
["medium"]="reverb 40 50 70"
|
|
35
|
+
["heavy"]="reverb 70 50 100"
|
|
36
|
+
["cathedral"]="reverb 90 30 100"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
# @function get_agent_effects
|
|
40
|
+
# @intent Get current effects configuration for an agent
|
|
41
|
+
# @param $1 Agent name (or "default")
|
|
42
|
+
# @returns Echoes the SOX effects string
|
|
43
|
+
get_agent_effects() {
|
|
44
|
+
local agent_name="$1"
|
|
45
|
+
|
|
46
|
+
if [[ ! -f "$CONFIG_FILE" ]]; then
|
|
47
|
+
echo ""
|
|
48
|
+
return
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# Read agent config line, format: AGENT_NAME|SOX_EFFECTS|BACKGROUND_FILE|BACKGROUND_VOLUME
|
|
52
|
+
local config_line=$(grep "^${agent_name}|" "$CONFIG_FILE" 2>/dev/null || echo "")
|
|
53
|
+
|
|
54
|
+
if [[ -z "$config_line" ]]; then
|
|
55
|
+
# Try default
|
|
56
|
+
config_line=$(grep "^default|" "$CONFIG_FILE" 2>/dev/null || echo "")
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
if [[ -n "$config_line" ]]; then
|
|
60
|
+
echo "$config_line" | cut -d'|' -f2
|
|
61
|
+
else
|
|
62
|
+
echo ""
|
|
63
|
+
fi
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
# @function set_reverb
|
|
67
|
+
# @intent Set reverb level for an agent or globally
|
|
68
|
+
# @param $1 Reverb level (off, light, medium, heavy, cathedral)
|
|
69
|
+
# @param $2 Agent name (optional, defaults to "default")
|
|
70
|
+
# @param $3 --all flag (optional, applies to all agents)
|
|
71
|
+
set_reverb() {
|
|
72
|
+
local level="$1"
|
|
73
|
+
local agent_name="${2:-default}"
|
|
74
|
+
local apply_all="${3:-}"
|
|
75
|
+
|
|
76
|
+
# Validate level
|
|
77
|
+
if [[ ! -v REVERB_LEVELS[$level] ]]; then
|
|
78
|
+
echo "❌ Invalid reverb level: $level"
|
|
79
|
+
echo "Valid levels: off, light, medium, heavy, cathedral"
|
|
80
|
+
return 1
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
local reverb_effect="${REVERB_LEVELS[$level]}"
|
|
84
|
+
|
|
85
|
+
if [[ "$apply_all" == "--all" ]]; then
|
|
86
|
+
# Apply to all agents in config
|
|
87
|
+
echo "🎛️ Setting reverb to '$level' for all agents..."
|
|
88
|
+
|
|
89
|
+
# Create temp file
|
|
90
|
+
local temp_file="${CONFIG_FILE}.tmp"
|
|
91
|
+
|
|
92
|
+
# Process each line
|
|
93
|
+
while IFS='|' read -r agent sox_effects bg_file bg_vol || [[ -n "$agent" ]]; do
|
|
94
|
+
# Skip comments and empty lines
|
|
95
|
+
if [[ "$agent" =~ ^# ]] || [[ -z "$agent" ]]; then
|
|
96
|
+
echo "$agent|$sox_effects|$bg_file|$bg_vol" >> "$temp_file"
|
|
97
|
+
continue
|
|
98
|
+
fi
|
|
99
|
+
|
|
100
|
+
# Remove existing reverb from sox effects
|
|
101
|
+
local new_effects=$(echo "$sox_effects" | sed -E 's/reverb [0-9]+ [0-9]+ [0-9]+//g' | sed 's/ */ /g' | sed 's/^ //;s/ $//')
|
|
102
|
+
|
|
103
|
+
# Add new reverb if not off
|
|
104
|
+
if [[ -n "$reverb_effect" ]]; then
|
|
105
|
+
if [[ -n "$new_effects" ]]; then
|
|
106
|
+
new_effects="$reverb_effect $new_effects"
|
|
107
|
+
else
|
|
108
|
+
new_effects="$reverb_effect"
|
|
109
|
+
fi
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
echo "${agent}|${new_effects}|${bg_file}|${bg_vol}" >> "$temp_file"
|
|
113
|
+
done < "$CONFIG_FILE"
|
|
114
|
+
|
|
115
|
+
# Replace original with temp
|
|
116
|
+
mv "$temp_file" "$CONFIG_FILE"
|
|
117
|
+
|
|
118
|
+
echo "✅ Reverb set to '$level' for all agents"
|
|
119
|
+
else
|
|
120
|
+
# Apply to specific agent
|
|
121
|
+
echo "🎛️ Setting reverb to '$level' for '$agent_name'..."
|
|
122
|
+
|
|
123
|
+
# Check if agent exists in config
|
|
124
|
+
if ! grep -q "^${agent_name}|" "$CONFIG_FILE" 2>/dev/null; then
|
|
125
|
+
# Agent doesn't exist, add it with just reverb
|
|
126
|
+
echo "${agent_name}|${reverb_effect}|agentvibes_soft_flamenco_loop.mp3|0.30" >> "$CONFIG_FILE"
|
|
127
|
+
echo "✅ Created new config for '$agent_name' with reverb '$level'"
|
|
128
|
+
return
|
|
129
|
+
fi
|
|
130
|
+
|
|
131
|
+
# Create temp file
|
|
132
|
+
local temp_file="${CONFIG_FILE}.tmp"
|
|
133
|
+
|
|
134
|
+
# Process each line
|
|
135
|
+
while IFS='|' read -r agent sox_effects bg_file bg_vol || [[ -n "$agent" ]]; do
|
|
136
|
+
# Skip comments and empty lines
|
|
137
|
+
if [[ "$agent" =~ ^# ]] || [[ -z "$agent" ]]; then
|
|
138
|
+
echo "$agent|$sox_effects|$bg_file|$bg_vol" >> "$temp_file"
|
|
139
|
+
continue
|
|
140
|
+
fi
|
|
141
|
+
|
|
142
|
+
if [[ "$agent" == "$agent_name" ]]; then
|
|
143
|
+
# Remove existing reverb from sox effects
|
|
144
|
+
local new_effects=$(echo "$sox_effects" | sed -E 's/reverb [0-9]+ [0-9]+ [0-9]+//g' | sed 's/ */ /g' | sed 's/^ //;s/ $//')
|
|
145
|
+
|
|
146
|
+
# Add new reverb if not off
|
|
147
|
+
if [[ -n "$reverb_effect" ]]; then
|
|
148
|
+
if [[ -n "$new_effects" ]]; then
|
|
149
|
+
new_effects="$reverb_effect $new_effects"
|
|
150
|
+
else
|
|
151
|
+
new_effects="$reverb_effect"
|
|
152
|
+
fi
|
|
153
|
+
fi
|
|
154
|
+
|
|
155
|
+
echo "${agent}|${new_effects}|${bg_file}|${bg_vol}" >> "$temp_file"
|
|
156
|
+
else
|
|
157
|
+
echo "${agent}|${sox_effects}|${bg_file}|${bg_vol}" >> "$temp_file"
|
|
158
|
+
fi
|
|
159
|
+
done < "$CONFIG_FILE"
|
|
160
|
+
|
|
161
|
+
# Replace original with temp
|
|
162
|
+
mv "$temp_file" "$CONFIG_FILE"
|
|
163
|
+
|
|
164
|
+
echo "✅ Reverb set to '$level' for '$agent_name'"
|
|
165
|
+
fi
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
# @function list_effects
|
|
169
|
+
# @intent List current effects for all agents
|
|
170
|
+
list_effects() {
|
|
171
|
+
if [[ ! -f "$CONFIG_FILE" ]]; then
|
|
172
|
+
echo "❌ Config file not found: $CONFIG_FILE"
|
|
173
|
+
return 1
|
|
174
|
+
fi
|
|
175
|
+
|
|
176
|
+
echo "📊 Current Audio Effects Configuration:"
|
|
177
|
+
echo ""
|
|
178
|
+
|
|
179
|
+
while IFS='|' read -r agent sox_effects bg_file bg_vol || [[ -n "$agent" ]]; do
|
|
180
|
+
# Skip comments and empty lines
|
|
181
|
+
if [[ "$agent" =~ ^# ]] || [[ -z "$agent" ]]; then
|
|
182
|
+
continue
|
|
183
|
+
fi
|
|
184
|
+
|
|
185
|
+
# Extract reverb level if present
|
|
186
|
+
local reverb_level="off"
|
|
187
|
+
if [[ "$sox_effects" =~ reverb\ ([0-9]+)\ ([0-9]+)\ ([0-9]+) ]]; then
|
|
188
|
+
local reverb_val="${BASH_REMATCH[1]}"
|
|
189
|
+
if [[ "$reverb_val" -le 20 ]]; then
|
|
190
|
+
reverb_level="light"
|
|
191
|
+
elif [[ "$reverb_val" -le 40 ]]; then
|
|
192
|
+
reverb_level="medium"
|
|
193
|
+
elif [[ "$reverb_val" -le 70 ]]; then
|
|
194
|
+
reverb_level="heavy"
|
|
195
|
+
else
|
|
196
|
+
reverb_level="cathedral"
|
|
197
|
+
fi
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
echo " $agent: reverb=$reverb_level"
|
|
201
|
+
if [[ -n "$sox_effects" ]]; then
|
|
202
|
+
echo " Effects: $sox_effects"
|
|
203
|
+
fi
|
|
204
|
+
done < "$CONFIG_FILE"
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
# @function get_reverb_level
|
|
208
|
+
# @intent Get current reverb level for an agent
|
|
209
|
+
# @param $1 Agent name (or "default")
|
|
210
|
+
# @returns Echoes reverb level name (off, light, medium, heavy, cathedral)
|
|
211
|
+
get_reverb_level() {
|
|
212
|
+
local agent_name="$1"
|
|
213
|
+
local effects=$(get_agent_effects "$agent_name")
|
|
214
|
+
|
|
215
|
+
if [[ -z "$effects" ]] || [[ ! "$effects" =~ reverb ]]; then
|
|
216
|
+
echo "off"
|
|
217
|
+
return
|
|
218
|
+
fi
|
|
219
|
+
|
|
220
|
+
# Extract reverb parameters
|
|
221
|
+
if [[ "$effects" =~ reverb\ ([0-9]+)\ ([0-9]+)\ ([0-9]+) ]]; then
|
|
222
|
+
local reverb_val="${BASH_REMATCH[1]}"
|
|
223
|
+
if [[ "$reverb_val" -le 20 ]]; then
|
|
224
|
+
echo "light"
|
|
225
|
+
elif [[ "$reverb_val" -le 40 ]]; then
|
|
226
|
+
echo "medium"
|
|
227
|
+
elif [[ "$reverb_val" -le 70 ]]; then
|
|
228
|
+
echo "heavy"
|
|
229
|
+
else
|
|
230
|
+
echo "cathedral"
|
|
231
|
+
fi
|
|
232
|
+
else
|
|
233
|
+
echo "off"
|
|
234
|
+
fi
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
# Main command dispatcher
|
|
238
|
+
case "${1:-help}" in
|
|
239
|
+
set-reverb)
|
|
240
|
+
if [[ -z "${2:-}" ]]; then
|
|
241
|
+
echo "Usage: effects-manager.sh set-reverb <level> [agent-name] [--all]"
|
|
242
|
+
echo "Levels: off, light, medium, heavy, cathedral"
|
|
243
|
+
exit 1
|
|
244
|
+
fi
|
|
245
|
+
set_reverb "$2" "${3:-default}" "${4:-}"
|
|
246
|
+
;;
|
|
247
|
+
get-reverb)
|
|
248
|
+
get_reverb_level "${2:-default}"
|
|
249
|
+
;;
|
|
250
|
+
get-effects)
|
|
251
|
+
get_agent_effects "${2:-default}"
|
|
252
|
+
;;
|
|
253
|
+
list)
|
|
254
|
+
list_effects
|
|
255
|
+
;;
|
|
256
|
+
*)
|
|
257
|
+
echo "Usage: effects-manager.sh {set-reverb|get-reverb|get-effects|list}"
|
|
258
|
+
echo ""
|
|
259
|
+
echo "Commands:"
|
|
260
|
+
echo " set-reverb <level> [agent] [--all] Set reverb level"
|
|
261
|
+
echo " get-reverb [agent] Get current reverb level"
|
|
262
|
+
echo " get-effects [agent] Get all effects for agent"
|
|
263
|
+
echo " list List all agent effects"
|
|
264
|
+
echo ""
|
|
265
|
+
echo "Reverb Levels: off, light, medium, heavy, cathedral"
|
|
266
|
+
exit 1
|
|
267
|
+
;;
|
|
268
|
+
esac
|