Skip to content

Commit 0962779

Browse files
committed
feat: rename gain value from value to gain_db
1 parent 6ce9b80 commit 0962779

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

rust/config.example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ processing:
276276
- id: "gain_amplifier"
277277
node_type: "gain"
278278
parameters:
279-
value: 3.0 # +3 dB gain (approximately 1.41x amplification)
279+
gain_db: 3.0 # +3 dB gain (approximately 1.41x amplification)
280280

281281
- id: "streaming_bandpass_filter"
282282
node_type: "streaming"

rust/resources/config.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,13 +672,13 @@
672672
"parameters": {
673673
"type": "object",
674674
"properties": {
675-
"value": {
675+
"gain_db": {
676676
"type": "number",
677677
"description": "Gain value in decibels (dB). Positive values amplify, negative values attenuate."
678678
}
679679
},
680680
"required": [
681-
"value"
681+
"gain_db"
682682
],
683683
"additionalProperties": false
684684
}

rust/src/processing/graph.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,10 +1096,11 @@ impl ProcessingGraph {
10961096
.ok_or_else(|| anyhow::anyhow!("Gain node requires parameters"))?;
10971097

10981098
let gain_db = params
1099-
.get("value")
1099+
.get("gain_db")
11001100
.and_then(|v| v.as_f64())
1101-
.ok_or_else(|| anyhow::anyhow!("Gain node requires 'value' parameter in dB"))?
1102-
as f32;
1101+
.ok_or_else(|| {
1102+
anyhow::anyhow!("Gain node requires 'gain_db' parameter in dB")
1103+
})? as f32;
11031104

11041105
Ok(Box::new(GainNode::new(config.id.clone(), gain_db)))
11051106
}

0 commit comments

Comments
 (0)