Skip to content

How can obtain audioData from oboe::FifoBuffer with the callback #2152

Closed Answered by philburk
John4650-hub asked this question in Q&A
Discussion options

You must be logged in to vote

I see several problems here:

Your function getPcmData() does not seem to wait for room in the FIFO. So it just runs full speed until all the data is read. If the FIFO. If the FIFO is full then the data will be dropped. If you want to stream data to Oboe then you should check to see if there is enough room in the buffer for the data to be written. Then sleep until there is room.

You are allocating the buffer to be the totalFrames. If you are simply going to read the entire file into one array then you don't need a FIFO. But if you plan on streaming a large amount of data then just allocate enough to avoid buffer underflows.

You set bytesPerFrame = 4 but then you allocate a stream with ster…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@John4650-hub
Comment options

Answer selected by John4650-hub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants