In the doucumentation "Buffer" appars in different contexts,
- record buffer
- (stream) decode buffer
- double buffer
- callback buffer
- stream buffer
- "all streams are pre-buffered"
- "reflush of a buffer"
- to prebuffer
Can anyone help me understanding meanings of the buffer concept in eight cirumstances listed above?
With best regards
- zorank asked 8 years ago
Thanks for reply! I realize from your reply that I was not clear about what I am after. In FMOD there are various scenarios how buffers are used. I was intersted in making a catalogue of these scenarios. In documentation I found eight ways of talking about buffer. I have changed title of the topic to emphasize what I am after.
In brief, I am really interested in understanding how buffer is used in various scenarios in FMOD architecture.
1. record buffer
2. (stream) decode buffer
3. double buffer
4. callback buffer
5. stream buffer
6. "all streams are pre-buffered"
7. "reflush of a buffer"
8. to prebuffer
i presume you understand terms such as asynchronous operations, streaming etc…?
- a chunk of memory where captured data is written
- a chunk of memory where parts (also buffers) of stream are decoded into, ie: if a stream is mp3, it can be decoded (into pcm for example) chunk by chunk and the fed to output device
- two chunks of memory, which are being swapped, while one is being read, other can be written, this is basically an optimization
- this one can be pretty much anything
- a chunk of memory, where the data from file is being read into, presumably and async reading operation, ie: you read 256kb of data, play for X seconds and when it is nearing the end, read another 256kb (can use double buffer here)
- if you know that some data is going to be used, and you want this data to be read in a an async way, you can prebuffer (pre-read) the first part of it. this way, when you say play, it starts playing immediately
- when wrong data is being streamed, you have to flush the buffers, so that new data can start with a clean slate
- can apply to any kind of read operation, pretty much same as point 6
pretty much all this is handled by the fmod itself, you do have some control on how large the streaming buffers are for example. just give fmod a pre-allocated chunk of memory (a buffer ;)) and it will do its magic, hopefully 8)
Oh boy, many thanks for clarifications. Really appreciate it!
I start to be nervous since it seems that only "old foxes" (experienced developers) venture into this forum. Please bear with me… I found the FMOD documentation very hard to use (probably taylored to experienced developers) so in pure desperation I turned to this forum.
Many tanks again. I will study your reply carefully. By the way, could I kindly ask you too look into following post:
it is about locking the buffer by sound::lock. Hope you could scratch some time to help me there.
With best regards
Please login first to submit.