Question

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?

Was it helpful?

Solution

The purpose of ASIO is to provide high-performance abstraction for multi-channel audio interfaces.

In the domain that it was designed - that is to say professional audio applications - channels counts are often much higher than two, and whether any pair of channels is a stereo bus - and which channel is which - really depends on how the user has connected the inputs and outputs of their interface.

The ASIO API doesn't provide a means of retrieving routing information for channels - such as name-labels or where they are connected to. Even - as is often the case - the audio interface's control panel software does have this facility.
This has been a long-standing deficit in ASIO.

The use of a group of channels (e.g. a stereo or 5.1 bus) is purely convention. At least in stereo applications, the left channel is usually the lower numbered channel of the sequential pair.

If you're using MacOSX, CoreAudio does provide both names channels and meaning audio routing data. As ASIO works as a thin wrapper between the application and the CoreAudio APIs, you could obtain this.

OTHER TIPS

You could write some code which outputs audio to only one channel (say channel 1), and listen to which side is played (assuming your rig is set up right). Do the same for each of the channels (assuming more than just two ... if it is just two you can stop at testing one channel) The centre channel would be the same as the "mono" channel that you refer to in your question. CHEERS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top