Caleb Merchant
Caleb Merchant

Reputation: 316

ASIO SDK how to process audio buffers

So I am working on some audio processing software and I'm kinda confused on some of the ASIO audio processing. From what I'm reading, It seems like when the buffer switch callback is made, I need to process the "input" into the "output". But what if I have a different number of input and output channels? And I'm guessing I need to do the format conversions if my input and output format do not match right?

Upvotes: 2

Views: 732

Answers (1)

Antonio Paredes Picon
Antonio Paredes Picon

Reputation: 51

What you have to do is access to asioDriverInfo.inputsChannels and asioDriverInfo.inputBuffers. I used this code snippet to figure out my device input/ output enumeration. I Hope it helps.

    string cad;
    if (ASIOStart() == ASE_OK)
    {
        for (int i = 0; i < asioDriverInfo.inputChannels + asioDriverInfo.outputChannels; i++)
        {
            cad =  asioDriverInfo.channelInfos[i].isInput? "input" : "output ";
            cout<<"Chanel "<<i<<" : "<<asioDriverInfo.channelInfos[i].name<<" "<<cad<<endl;
        }               
        for (int i = 0; i < asioDriverInfo.inputBuffers + asioDriverInfo.outputBuffers; i++)
        {
            cad =  asioDriverInfo.bufferInfos[i].isInput? "input" : "output ";
            cout<<"Buffer "<<i<<asioDriverInfo.bufferInfos[i].buffers<<" : " << cad  <<" chanel "<<asioDriverInfo.bufferInfos[i].channelNum<<endl;
        }
    ...and rest of stuff

Upvotes: 0

Related Questions