Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:disk_streaming [2015/04/09 12:22] devadev:disk_streaming [2015/04/09 17:35] (current) deva
Line 13: Line 13:
 =====Design===== =====Design=====
 {{:dev:diskstreaming.png?nolink|}} {{:dev:diskstreaming.png?nolink|}}
 +  * Each sample has an initial chunk loaded on drumkit load time. This data is stored in the AudioFile object. The initial chunksize can be set to "full" to adapt the current behavior of loading all samples fully into memory (ie. disable disk streaming).
 +  * Once the sample gets triggered by an input event a EventSample object is allocated containing a sample position ''t'' as well as a pointer to the AudioFile object containing the preloaded data. The fron-buffer is initially set to point to the preloaded data.
 +  * On each run iteration, the sample counter ''t'' is incremented.
 +  * Once the value of ''t'' reaches the "trigger point 1", the loader is signalet to start loading chunk1 into the back-buffer of the EventSample object.
 +  * Once the value of ''t'' reaches the end of the front-buffer, the back and front buffers are switched and the "internal" buffer pointer is set to 0.
 +  * When the value of ''t'' reaches "trigger point 2" the loader is signaled to start loading chunk2 into tyhe back-buffer.
 +  * ... and so on and so forth - until the end of the sample has been reached ...
 +
 +The samples are stored in multi-channel wav files, so we want to read in multiple channels at once in the loader thread since all channels are played (and therefore loaded) in parallel. Therefore the EventSample should be referencing the Sample object and not the AudioFile object alone...
 +
 +=====FileLoader=====
 +Receives events/queries for chunk loading.
 +
 +Request : //(filename/ref, channelnumber, position [size from manager??])//
 +
 +If filename/ref and position is the same on consecutive requests, but the channel numbers are different, the requests are reads from the same multi-channel file and is to be collapsed into a single read with writes to multiple buffers. 
 +
 +Once a file is opened, it should stay opened as long as the sample is active.
dev/disk_streaming.1428574927.txt.gz · Last modified: 2015/04/09 12:22 by deva
Trace:
GNU Free Documentation License 1.3
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0