Hi… I’ve this problem:
I have to use 8 audio channels in output.
So, i choose the sound card and select the 8 channels, but the “audiosamplebuffer info” that i use in the getNextAudioBlock has always just 2 channels; it let me stream audio just to the first two channel selected in the selector (eg, if i select 1…8 audio comes out from monitor 1&2, if i deselect channels 1&2 audio comes out from monitor 3&4…)
I think that when i choose the sound card in the AudioDeviceSelectorComponent it has to change the channel number in the buffer… but nothing!
so it’s not atomatic that if i select 8 (or more…) channel in the selector the buffer will become an 8 channel uffer??
but anyhow, when i create the devicemanager i do this:
const String error (audioDeviceManager.initialise (1, /* number of input channels */
8, /* number of output channels */
0, /* no XML settings.. */
true /* select default device on failure */));
if (error.isNotEmpty())
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
T("Audio Demo"),
T("Couldn't open an output device!\n\n") + error);
}
else
{
// ..and connect the mixer to our source player.
audioSourcePlayer.setSource (&transportSource2);
// start the IO device pulling its data from our callback..
audioDeviceManager.setAudioCallback (this);
/* other stuff */
}
audioSettingsComp=new AudioDeviceSelectorComponent ( audioDeviceManager,
0, 1,
2, 8,
true);
audioSettingsComp->setSize (500, 300);
but always just 2 channels opened…
maybe it’s becouse, by default, my app first open a sound card with 2 chan out… then i choose the other one…
Maybe it’s becouse of my english…
Ok, let me explain better than before…
In the constructor of the main component i do this:
const String error (audioDeviceManager.initialise (1, /* number of input channels */
8, /* number of output channels */
0, /* no XML settings.. */
true /* select default device on failure */));
if (error.isNotEmpty())
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
T("Audio Demo"),
T("Couldn't open an output device!\n\n") + error);
}
else
{
// ..and connect the mixer to our source player.
audioSourcePlayer.setSource (&transportSource2);
// start the IO device pulling its data from our callback..
audioDeviceManager.setAudioCallback (this);
/* other stuff */
}
audioSettingsComp=new AudioDeviceSelectorComponent ( audioDeviceManager,
0, 1,
2, 8,
true);
When i run the app, it choose the default audiodevice that has 2 output channels.
Then I open the AudioDeviceSelectorComponent and choose the other audiodevice selecting all the 8 output channels.
But when i “play” audio just the first 2 channels selected (1&2 or, if 1&2 are uncecked, 3&4…) will stream audio; this (i think) becouse info.buffer in the getNextAudioBlock got still 2 output channels.
I thought that selecting the right audiodevice and selecting the output channels to open then info.buffer would change with it.
Ok. If you can select and activate 8 channels in the audio device panel, then the audio device will definitely be delivering an 8-channel buffer in its callback…
But I think I recently fixed the AudioSourcePlayer code because that was only passing on the first two channels to the audio source… Are you using the latest juce version?
I’m working on some multi-channel apps at the moment and they work just fine, so it’s very unlikely to be a bug - you must just be misunderstanding something.
The debug info shows that it is opening that many channels, so I assume you’re getting them in your callback. Sorry, without seeing all your code I can’t guess what else you might be missing…
Eh? Of course the cello only uses 2 channels, it’s a stereo sample. And the demo’s only designed to use 2 channels anyway. Not sure I understand what you think is wrong?
let me explain…
i modified the jucedemo code to use asio device and then i select my device (that allow to use up to 10 out channels).
Now if i play midi it sounds good…
i know that cello is a stereo file but i thought, maybe i was wrong, that it would play the same…
where MyMixer, Filter and Channel inherit from PositionableAudioSource.
In this situation I can play, stop and other but the channel number for MyMixer is always 2!
it let me change the channel number in MyMixer in whatever I choose in the AudioDeviceSelector… but, obviously, becouse of there’s no transportsource, i cannot start playing and other…