Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: Plays in speakers, but not in headphones

$
0
0

I am having the similar problem if switching audio devices. You have to detect if any audio device (endpoint from now on) is added (enabled) or removed (disabled) and redirect the audio to the new default device. Unfortunately NAudio seems not to do it automatically at this time as your case proves.

The Windows 7 audio subsystem (default audio endpoint selection) were rewritten. This means that an audio endpoints has priority over the other. For example if you plug-in a bluetooth headphones they will be set as the default audio endpoint. Even if you have other wired pair headset connected.

The point is that Windows's audio system developers want to prohibit audio applications to set default endpoint. So Windows user could control the default device directly from the control panel. Anyway this is a bit of off-topic now.


Windows 7 determines a default audio endpoint for any specific role:

  • The audio subsystem loops through all the ACTIVE endpoints with a matching device role to find the endpoint with the most recent timestamp property. The timestamp property indicates the last time an endpoint was set as the default audio endpoint.
  • If such an audio endpoint is found, it is returned as the default audio endpoint.
  • Otherwise, the audio subsystem resorts to the system default audio endpoint heuristic algorithm to determine the default audio endpoint.
  • When the heuristic selects the default communications endpoint, it assigns higher priority to Bluetooth headphone endpoints than to onboard HD Audio headphones.
  • When it selects the default speaker endpoint, it assigns higher priority to speaker endpoints that have jack detection capability than to static speaker endpoints.
  • When it selects the default capture device, it assigns higher priority to front microphone endpoints than to microphones in the rear of a computer.
  • When it selects the default console render endpoint, it assigns higher priority to S/PDIF endpoints than to handset endpoints. When it selects the default communications render endpoint, it assigns higher priority to handset endpoints than to S/PDIF endpoints.
  • The heuristic can designate an endpoint that has specific characteristics to be the top priority or the lowest priority. For example, it can make a jack detection capable HD Audio headphone endpoint on the right of a computer be the highest priority default communication render device.

These were taken from "Default Audio Endpoint Selection in Windows 7" DOCX at http://msdn.microsoft.com/en-us/windows/hardware/gg463052.aspx where you could find some additional information that might interest you.


Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>