vapi_client/models/fourier_denoising_plan.rs
1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct FourierDenoisingPlan {
16 /// Whether Fourier denoising is enabled. Note that this is experimental and may not work as expected.
17 #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
18 pub enabled: Option<bool>,
19 /// Whether automatic media detection is enabled. When enabled, the filter will automatically detect consistent background TV/music/radio and switch to more aggressive filtering settings. Only applies when enabled is true.
20 #[serde(
21 rename = "mediaDetectionEnabled",
22 skip_serializing_if = "Option::is_none"
23 )]
24 pub media_detection_enabled: Option<bool>,
25 /// Static threshold in dB used as fallback when no baseline is established.
26 #[serde(rename = "staticThreshold", skip_serializing_if = "Option::is_none")]
27 pub static_threshold: Option<f64>,
28 /// How far below the rolling baseline to filter audio, in dB. Lower values (e.g., -10) are more aggressive, higher values (e.g., -20) are more conservative.
29 #[serde(rename = "baselineOffsetDb", skip_serializing_if = "Option::is_none")]
30 pub baseline_offset_db: Option<f64>,
31 /// Rolling window size in milliseconds for calculating the audio baseline. Larger windows adapt more slowly but are more stable.
32 #[serde(rename = "windowSizeMs", skip_serializing_if = "Option::is_none")]
33 pub window_size_ms: Option<f64>,
34 /// Percentile to use for baseline calculation (1-99). Higher percentiles (e.g., 85) focus on louder speech, lower percentiles (e.g., 50) include quieter speech.
35 #[serde(rename = "baselinePercentile", skip_serializing_if = "Option::is_none")]
36 pub baseline_percentile: Option<f64>,
37}
38
39impl FourierDenoisingPlan {
40 pub fn new() -> FourierDenoisingPlan {
41 FourierDenoisingPlan {
42 enabled: None,
43 media_detection_enabled: None,
44 static_threshold: None,
45 baseline_offset_db: None,
46 window_size_ms: None,
47 baseline_percentile: None,
48 }
49 }
50}