| 68 | #[cfg_attr(feature = "bevy", derive(bevy_ecs::prelude::Component))] |
| 69 | #[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))] |
| 70 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] |
| 71 | pub struct ConvolutionNode { |
| 72 | /// The impulse response to use. |
| 73 | #[cfg_attr(feature = "bevy_reflect", reflect(ignore))] |
| 74 | #[cfg_attr(feature = "serde", serde(skip))] |
| 75 | pub impulse_response: Option<ArcGc<dyn SampleResourceF32 + Send + Sync + 'static>>, |
| 76 | |
| 77 | /// Pause the convolution processing. |
| 78 | /// |
| 79 | /// This prevents a tail from ringing out when you want all sound to |
| 80 | /// momentarily pause. |
| 81 | pub pause: bool, |
| 82 | |
| 83 | /// The output gain. |
| 84 | /// |
| 85 | /// Defaults to -20dB to balance the volume increase likely to occur when |
| 86 | /// convolving audio. Values closer to 1.0 may be very loud. |
| 87 | pub wet_gain: Volume, |
| 88 | |
| 89 | /// Adjusts the time in seconds over which parameters are smoothed for `mix` |
| 90 | /// and `wet_gain`. |
| 91 | /// |
| 92 | /// By default this is set to `0.062` (62ms). This value is chosen such that |
| 93 | /// the stair-stepping effect isn't noticeable for a typical block size of 1024 |
| 94 | /// samples. |
| 95 | pub smooth_seconds: f32, |
| 96 | } |
| 97 | |
| 98 | impl Default for ConvolutionNode { |
nothing calls this directly
no outgoing calls
no test coverage detected