Skip to content

Commit

Permalink
Removed ToggleMute added Audio
Browse files Browse the repository at this point in the history
  • Loading branch information
mansman12 authored and grigio committed Jan 12, 2025
1 parent 2e3d57a commit 52782c5
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,27 @@ let client = match std::env::var("OBS_WEBSOCKET_URL") {
}
}

Commands::ToggleMute { device } => {
println!("Toggling mute on device: {:?} ", device);
Commands::Audio {
command,
device
} => {
println!("Audio: {:?} {:?}", command, device);

let res = client.inputs().toggle_mute(device).await;
let muted: bool = match command.as_str() {
"mute" => true,
"unmute" => false,
"toggle" => !client.inputs().muted(device).await?,
"status" => {
let status = client.inputs().muted(device).await?;
println!("Muted: {:?}", status);
return Ok(());
}
_ => {
println!("Invalid audio command: {:?}", command);
return Ok(());
}
};
let res = client.inputs().set_muted(device, muted).await;
println!("Result: {:?}", res);
}

Expand Down

0 comments on commit 52782c5

Please sign in to comment.