How to prevent audio to be sent to the default audio endpoint?

Wong, Irene 0 Reputation points
2024-05-22T23:27:05.93+00:00

Hi,

I've some audio that I would like to only be sent to a particular audio endpoint (in this case, a controller output). I basically use IMMDeviceEnumerator::EnumAudioEndpoints() to get the endpoint I want and send audio to the device buffer using IAudioRenderClient::GetBuffer(). That works as I expect. But when I have another audio device (e.g. a headset) set as the default audio endpoint, the audio intended only for the controller is being output to both the controller speaker as well as the headset. Is there any way to prevent audio from going to the default audio endpoint?

To add to the issue, my 2 devices have different sample rate. So the automatic routing to both endpoints do not work as one of the endpoint will sound incorrect due to the sample rate mismatch.

Thanks.

Irene

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,472 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Tong Xu - MSFT 2,116 Reputation points Microsoft Vendor
    2024-06-04T02:44:37.2066667+00:00

    Sending zeros to the headphones' buffer is not advisable! It turns into autofill or makes the buffer pointer zero. Null pointer is violation. You were not send zero to ppData so here is autofill the buffer.

    so I expect to hear nothing from the headphones.

    You can try use IAudioClient::Stop method to stop recording the audio stream.
    Or delete the audio device in driver
    audio-endpoint-control-panel

    Because Microsoft does not provide the method to remove audio endpoints dynamically.

    0 comments No comments

  3. Asma khalida 0 Reputation points
    2024-06-04T02:49:25.3633333+00:00

    To prevent audio from being sent to the default audio endpoint on a Windows system, you can redirect it to a different audio device or mute it using the following steps:

    Change the Default Playback Device:

    Right-click the sound icon in the system tray and select "Open Sound settings."

    Under "Output," choose a different audio device from the drop-down menu.

    Use Software Settings:

    Many applications allow you to select a specific audio output device in their settings. Configure the application to use a non-default audio device. For more details if anyone is interested in to know about Integrity Garage door repairs huntington visit here

    0 comments No comments