This project has moved. For the latest updates, please go here.

Asio Channel offset pairs

Nov 14, 2012 at 2:33 AM

Hi All,

I was wondering if there was a way to display the asio channel offset in pair for stereo?

eg channel offset 0 is the first channel on my card. Is it possable to display that as

Channel 1+2?

Thanks, Wyatt

Nov 14, 2012 at 6:42 AM

I'm not sure what you mean. What you display is up to you. If you are using channel offset 0 and writing two channels, you can call that "Channel 1+2" if you want.

Nov 14, 2012 at 5:26 PM
Edited Nov 14, 2012 at 5:47 PM

I mean is there a way to get the number of Asio Channels, and display them to a combo box?

Like there is for WaveOut.DeviceCount, but add AsioOut.ChannelCount?

Nov 14, 2012 at 5:31 PM

I recently checked in a change that adds properties for this (DriverInputChannelCount and DriverOutputChannelCount)

Nov 14, 2012 at 8:13 PM

Any chance of a code snippet, or could it be included in the NAudio Demo?

Thanks, Wyatt

Nov 16, 2012 at 10:37 AM

Just call those properties on AsioOut. They return integers.

Nov 16, 2012 at 5:59 PM

Thanks Mark.

Is there a way to get AsioOut.GetCapabilities?

Sorry for the confusion.

Heres what I'm trying to do.

Here's an example on a windows form with a button and listbox using WaveOut.

Is it possible to do this with AsioOut?


    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click

        ListBox1.Items.Add("Wave in :")
        Dim waveInDevices As Integer = WaveIn.DeviceCount
        For waveInDevice As Integer = 0 To waveInDevices - 1
            Dim deviceInfo As WaveInCapabilities = WaveIn.GetCapabilities(waveInDevice)
            ListBox1.Items.Add("Device {0}: {1}, {2} channels" & " , " & Convert.ToString(waveInDevice) & " , " & Convert.ToString(deviceInfo.ProductName))
        Next waveInDevice
        ListBox1.Items.Add("Wave out :")
        Dim waveOutDevices As Integer = waveOut.DeviceCount
        For waveOutDevice As Integer = 0 To waveOutDevices - 1
            Dim deviceInfo As WaveOutCapabilities = WaveOut.GetCapabilities(waveOutDevice)
            ListBox1.Items.Add("Device {0}: {1}, {2} channels" & " , " & Convert.ToString(waveOutDevices) & " , " & Convert.ToString(deviceInfo.ProductName))
    End Sub



Nov 17, 2012 at 8:54 AM

unfortunately I you have to open the ASIO device to query it for channel count, so you'd have to write your own code that creates a new instance of AsioOut for each driver and asks it for these properties.

Nov 19, 2012 at 11:32 PM
Edited Nov 19, 2012 at 11:57 PM

Thanks Mark.

I finally made some progress on this. I can get the right offset numbers to display in a combobox, but I don't know how to convert that to read what I want it to.

My card is 16 channels, and I want stereo only.

Does this look correct?


        Dim mycount As New AsioOut

        For i As Integer = 0 To mycount.DriverOutputChannelCount - 2 Step +2



Nov 20, 2012 at 3:04 PM

sure, if your combo box only needs to display a number. You'd normally use a String.Format to do something like String.Format("Channels {0}-{1}", i, i+1)

then use the selected combo box index to work out the offset you want to use when opening Asio for playback.