oboe icon indicating copy to clipboard operation
oboe copied to clipboard

Update the full guide to mention that `getFramesRead|Written` are available when using OpenSLES

Open dturner opened this issue 4 years ago • 0 comments

Discussed in https://github.com/google/oboe/discussions/1434

Originally posted by YouheiLee November 8, 2021 At the last of doc "Full Guide To Oboe" said that: getFramesRead(), getFramesWritten(), getTimestamp() will return Result::ErrorUnimplemented for OpenSLES streams, But I found that in AudioStream.cpp, there has a implementation of getFramesRead():

int64_t AudioStream::getFramesRead() {
    updateFramesRead();
    return mFramesRead;
}

and in AudioOutputStreamOpenSLES.cpp, function updateFramesRead are also be implemented.

void AudioOutputStreamOpenSLES::updateFramesRead() {
    if (usingFIFO()) {
        AudioStreamBuffered::updateFramesRead();
    } else {
        mFramesRead = getFramesProcessedByServer();
    }
}

does it means those three functions(getFramesRead, getFramesWritten, getTimestamp) is also available in OpenSLES streams before OS version android O?

dturner avatar Nov 17 '21 17:11 dturner