Author Topic: Multi-channel audio playing problem.  (Read 366 times)

Lignuz

  • Posts: 17
Multi-channel audio playing problem.
« on: 11 Sep '18 - 08:02 »
Hi.
I tried to play multi-channel audio using bass library, but it does not played properly.

The test case is 5.1 channel wav file.
There was no problem playing using bass_wassapi.dll,
but there was a problem playing using bass.dll and bass_asio.dll.

When using bass.dll, the channels other than the left and right channels were not heard.
Audio output speed was slow when using bass_asio.dll.
You can check via contest.exe. (contest_asio.exe and contest_wasapi.exe are the filenames that I renamed.)

I am using a regular stereo earphone.
In case of ASIO, I installed asio4all and using it.

Check please.
Thanks.

Ian @ un4seen

  • Administrator
  • Posts: 21379
Re: Multi-channel audio playing problem.
« Reply #1 on: 11 Sep '18 - 13:50 »
What is the device's "Default Format" set in the Sound control panel? That will determine the format of BASS's output. From what you say, it sounds like that it stereo. BASS won't downmix multi-channel streams itself (eg. you will only here the first 2 channels with stereo output), but if wanted, you can use the BASSmix add-on for that, ie. create a stereo mixer and plug the file into it. It could look something like this:

Code: [Select]
decoder=BASS_StreamCreateFile(FALSE, filename, 0, 0, BASS_SAMPLE_FLOAT | BASS_STREAM_DECODE); // create decoder for audio file
BASS_CHANNELINFO info;
BASS_ChannelGetInfo(decoder, &info);
mixer=BASS_Mixer_StreamCreate(info.freq, 2, BASS_SAMPLE_FLOAT | BASS_MIXER_END); // create stereo mixer with same sample rate
BASS_Mixer_StreamAddChannel(mixer, decoder, BASS_MIXER_DOWNMIX); // plug decoder into mixer with downmixing enabled
BASS_ChannelPlay(mixer, 0); // start mixer

Please see the documentation for details on the mentioned functions.

Lignuz

  • Posts: 17
Re: Multi-channel audio playing problem.
« Reply #2 on: 12 Sep '18 - 07:16 »
Thanks!
Your hint was very helpful for me, and so I could fixed it.
But when I tested attached 8(7.1) ch sample audio file, some channel was not hearable.

It contains below:
"Front Left", "Front Right", "Center", "Back Left", "Back Right", beep tone sound, "Auxiliary Left", "Auxiliary Right"

But, last 2 channel's audio - "Auxiliary Left", "Auxiliary Right" - is not sounds.

Check please.

Ian @ un4seen

  • Administrator
  • Posts: 21379
Re: Multi-channel audio playing problem.
« Reply #3 on: 12 Sep '18 - 14:24 »
Yes, BASSmix does currently only include up to 6 channels (5.1) in the downmix. Here's an update that will go up to 8 (7.1), for you to try:

   www.un4seen.com/stuff/bassmix.zip