I want to implement voice mute function in C language

Asked 2 years ago, Updated 2 years ago, 38 views

I am making a Windows app in C language as a hobby, but I want to mute my computer, but I don't know what to do.
What I want to mute is Youtube sound.I want to turn off the audio when I run the program.
Does anyone know how to deal with it?

c windows

2022-09-29 21:57

1 Answers

As I mentioned in the comment, handling voice is very difficult.

  • Somehow controls the whole thing
  • The application controls which voice it makes
  • Control voice for specific other applications
    (e.g., mute browser audio)
  • Controls the output of a specific device
    (e.g., mute audio output during a call)

You need to specify what you want to accomplish.For your information, I'll give you a rough idea.

Some laptops and multimedia keyboards have mute keys.Therefore, Windows pre-embedded the action to be taken when the mute key is pressed (even if the keyboard is not connected).
This method will only cause unmute and unmute to toggle.This method is not available when it comes to understanding the current mute state and taking action according to the state.Also, since it's just a key operation, a pop-up will appear on the screen to indicate the state of the voice.

Emulating the mute key from the program will result in unmute and unmute.Specifically, you can pass the SendInput function with VK_VOLUME_MUTE.

INPUT input={INPUT_KEYBOARD, {VK_VOLUME_MUTE}};
SendInput(1, & input, size of input);


2022-09-29 21:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.