So, I decided to use JAsioHost ( https://github.com/mhroth/jasiohost ) to output audio through ASIO in my program.
Interaction with ASIO is done via an instance of AsioDriverListener
interface. ASIO host will call its void bufferSwitch(long sampleTime, long samplePosition, Set<AsioChannel> activeChannels)
method each time it wants new samples to playback. If I want to output mono sound, I just write the same data in all channels in the activeChannels
. But what if I want to make something more complex and therefore need to know exact channel configuration?
In the simple test stub program ( http://pastebin.com/sC870VJR ) the activeChannels
set is printed like:
#{#<AsioChannel Output Channel 0: HD Audio output 1, ASIOSTInt32LSB, group 0, inactive>
#<AsioChannel Output Channel 1: HD Audio output 2, ASIOSTInt32LSB, group 0, inactive>}
So I can know an index of each channel. The question is - how to determine which channel is really left, right, center, and so on?.. Or there is no way and I should leave it to user, who will manually tell their positions?