Portaudio MME设备行为问题

时间:2013-11-13 12:45:48

标签: portaudio

我正在使用paMME主机API提供的多输出设备功能,通过多个立体声设备输出音频。我还需要使用MME的单个多通道输入设备。 - 当我只配置输出设备并播放内部生成的音频时,没有问题。 - 但是,当我配置输入设备和多个立体声输出设备时,问题就开始出现了。当我尝试在输出上使用两个以上的通道时,应用程序崩溃。也就是说,如果我尝试将'out'指针递增超过2 * frames_per_buffer,它会崩溃,这表示缓冲区只分配给两个输出通道。

任何人都可以对可能出现的问题有所了解。配置代码如下:

    outputParameters.device = paUseHostApiSpecificDeviceSpecification;
    outputParameters.channelCount = 8;       
    outputParameters.sampleFormat = paInt16;
    outputParameters.hostApiSpecificStreamInfo = NULL;

    wmmeStreamInfo.size = sizeof(PaWinMmeStreamInfo);
    wmmeStreamInfo.hostApiType = paMME; 
    wmmeStreamInfo.version = 1;
    wmmeStreamInfo.flags = paWinMmeUseMultipleDevices;

    wmmeDeviceAndNumChannels[0].device = selectedDeviceIndex[0];
    wmmeDeviceAndNumChannels[0].channelCount = 2; 

    wmmeDeviceAndNumChannels[1].device = selectedDeviceIndex[1];
    wmmeDeviceAndNumChannels[1].channelCount = 2;

    wmmeDeviceAndNumChannels[2].device = selectedDeviceIndex[2];
    wmmeDeviceAndNumChannels[2].channelCount = 2;

    wmmeDeviceAndNumChannels[3].device = selectedDeviceIndex[3];
    wmmeDeviceAndNumChannels[3].channelCount = 2;

    wmmeStreamInfo.devices = wmmeDeviceAndNumChannels;
    wmmeStreamInfo.deviceCount = 4;

    outputParameters.suggestedLatency = Pa_GetDeviceInfo( selectedDeviceIndex[0] )->defaultLowOutputLatency;
    outputParameters.hostApiSpecificStreamInfo = &wmmeStreamInfo;

    inputParameters.device = selectedInputDeviceIndex; /* default output device */
    inputParameters.channelCount = 8;       /* stereo output */
    inputParameters.sampleFormat = paInt16; /* 32 bit floating point output */
    inputParameters.suggestedLatency = Pa_GetDeviceInfo( inputParameters.device )->defaultLowInputLatency;
    inputParameters.hostApiSpecificStreamInfo = NULL;

谢谢和问候,

Siddharth Kumar。

0 个答案:

没有答案