Function audio_visualizer::dynamic::window_top_btm::open_window_connect_audio
source · pub fn open_window_connect_audio(
name: &str,
preferred_height: Option<usize>,
preferred_width: Option<usize>,
preferred_x_range: Option<Range<f64>>,
preferred_y_range: Option<Range<f64>>,
x_desc: &str,
y_desc: &str,
input_dev_and_cfg: AudioDevAndCfg,
audio_data_transform_fn: TransformFn<'_>
)
Expand description
Starts the audio recording via cpal
on the given audio device (or the default input device),
opens a GUI window and displays two graphs. The upper graph is the latest audio input as
wave form (live/real time). The lower graph can be customized, to show for example a
spectrum or the lowpassed data.
This operation is blocking. It returns, when the GUI window is closed.
This operation is expensive and will be very laggy in “Debug” builds!
Parameters
name
Name of the GUI windowpreferred_height
Preferred height of GUI window. Default isDEFAULT_H
.preferred_width
Preferred height of GUI window. Default isDEFAULT_W
.preferred_x_range
Preferred range for the x-axis of the lower (=custom) diagram. If no value is present, the same value as for the upper diagram is used.preferred_y_range
Preferred range for the y-axis of the lower (=custom) diagram. If no value is present, the same value as for the upper diagram is used.x_desc
Description for the x-axis of the lower (=custom) diagram.y_desc
Description for the y-axis of the lower (=custom) diagram.preferred_input_dev
SeeAudioDevAndCfg
.audio_data_transform_fn
Seeopen_window_connect_audio
.