MCPcopy Create free account
hub / github.com/Recordscript/recordscript / select_microphone

Function select_microphone

src-tauri/src/main.rs:81–88  ·  view source on GitHub ↗
(selected_device: State<'_, SelectedDevice>, device_name: String)

Source from the content-addressed store, hash-verified

79
80#[tauri::command]
81fn select_microphone(selected_device: State<'_, SelectedDevice>, device_name: String) {
82 let device = recorder::list_microphone().into_iter()
83 .find(|device| device.name().unwrap_or_default() == device_name).unwrap();
84
85 selected_device.lock().unwrap().microphone = Some(device);
86
87 println!("Switching microphone to {device_name:?}");
88}
89
90#[tauri::command]
91fn select_speaker(selected_device: State<'_, SelectedDevice>, device_name: String) {

Callers

nothing calls this directly

Calls 2

list_microphoneFunction · 0.70
nameMethod · 0.45

Tested by

no test coverage detected