0

Q10 固件:10.1.0.4285

我正在尝试使用 OpenAL 来捕获声音,但是在 Q10 上我遇到了无法打开捕获设备的问题。在模拟器(v10_1_X.1483)上打开捕获设备是可以的(我还没有测试过实际的声音捕获)。

下面是我的代码片段。

qDebug() << "Available capture devices:";
devices = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
ptr = devices;
while (*ptr) {
    qDebug() << "** [" << ptr << "]";
    ptr += strlen(ptr) + 1;
}

// Open the capture device
qDebug() << "Opening capture device:";
const ALchar *deviceName;
ptr = devices;
while (*ptr) {
    qDebug() << "** Opening device [" << ptr << "]";
    captureDev = alcCaptureOpenDevice(ptr, 8000, AL_FORMAT_MONO8, 800);
    if (captureDev == NULL) {
        qDebug() << "** Unable to open capture device: [" << ptr << "]";
    } else {
        deviceName = ptr;
        qDebug() << "** Opened device [" << deviceName << "]";
        break;
    }
    ptr += strlen(ptr) + 1;
}

以下是输出结果:

Available capture devices: 
**  [ ASOUND Default ] 
**  [ MSM, MSM PCM 0 (CARD=0,DEV=1) ] 
Opening capture device: 
** Opening device [ ASOUND Default ] 
** Unable to open capture device: [ ASOUND Default ] 
** Opening device [ MSM, MSM PCM 0 (CARD=0,DEV=1) ] 
AL lib: asound_open_capture: Could not open capture device 'default': No such file or directory

Process 75899061 (BBTestSound) terminated SIGSEGV code=1 fltno=11 ip=78658774(/base/usr/lib/libOpenAL.so.1@StopThread+0x57f) mapaddr=00018774. ref=00000018
4

1 回答 1

1

Yaiba,您需要在 bar-descriptor 文件中请求录制音频的权限。之后,您将能够使用 ASOUND 默认值。

此致,

Rodrigo Peixoto BlackBerry - 应用程序开发顾问

于 2014-01-06T22:01:15.830 回答