Author Topic: List available speakers and/or output channels  (Read 38 times)

dennis_margelys

  • Posts: 73
Hi guys...

I would like to know if it is possible to list all speakers  in a specific device, I tried BASS_INFO but it only gives me the amount of speakers available.
for instance, I have a 5.1 USB soundcard and It has front center and rear speakers, i would like to show this info, and/or the output channels in case of a professional soundcard like M-AUDIO M-TRACK QUAD using only BASS and BASS_MIX

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: List available speakers and/or output channels
« Reply #1 on: 8 Dec '17 - 17:36 »
If I understand correctly, you want to detect (for example) whether 6 available speakers are in a 5.1 setup or just 6 separate output channels? BASS doesn't provide that info, and I'm not familiar with another way to get it. I guess it might be possible to detect from the channel mask value in the device's mix format; it might be 0 in the case of 6 separate outputs. If you would like to check the device's mix format, you can get it like this:

Code: [Select]
#include <audioclient.h>

#define BASS_OBJECT_AC 3 // IAudioClient

...

IAudioClient *ac=BASS_GetDSoundObject(BASS_OBJECT_AC); // get IAudioClient interface
if (ac) {
WAVEFORMATEX *wf;
if (SUCCEEDED(ac->GetMixFormat(&wf))) { // get current mix format
if (wf->wFormatTag==WAVE_FORMAT_EXTENSIBLE)
chanmask=((WAVEFORMATEXTENSIBLE*)wf)->dwChannelMask; // get the channel mask
CoTaskMemFree(wf); // free format buffer
}
}