AudioRecord :: processAudioBuffer()音频缓冲区来自哪里?

时间:2018-06-18 12:10:15

标签: android audiorecord audioflinger

我调查录音语音程序并在AudioRecord :: processAudioBuffer()中被阻止,这里是代码

nsecs_t AudioRecord::processAudioBuffer() {
   ...
   status_t err = obtainBuffer(&audioBuffer, requested, NULL, &nonContig);
   ...
}

status_t AudioRecord::obtainBuffer(Buffer* audioBuffer, const struct timespec *requested,
        struct timespec *elapsed, size_t *nonContig) {
   ...
   status = proxy->obtainBuffer(&buffer, requested, elapsed);
   ...
   audioBuffer->raw = buffer.mRaw;
   ...
}

__attribute__((no_sanitize("integer")))
status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *requested,
        struct timespec *elapsed) {
    ...
    buffer->mRaw = part1 > 0 ?
                    &((char *) mBuffers)[(mIsOut ? rear : front) * mFrameSize] : NULL;
    ...
}

我试着指出ClientProxy.mBuffers数据填充的位置以及audioflinger如何将解码后的语音数据传递给ClientProxy.mBuffers,但我在录音机代码中丢失了。

有人可以带我出去吗?谢谢!

0 个答案:

没有答案