Change/read disc buffer size

=> R0 = 1
R1 = new disc buffer size in bytes (<1024 for no change)

<= R0 = preserved
R1 = old disc buffer size in bytes
R2 = currently allocated size of each disc buffer



Since PlayIt double buffers the file, two buffers of the specified size are allocated. A dynamic area is used for the buffers if they are available. Memory is not (re)allocated until the next PlayIt_Play is executed so the value specified and return in R1 is really the size of future buffers. The value returned in R2 is how memory is actually being used right now for each buffer (ie 2*R2 bytes of memory is used in total).



The default size (when PlayIt is first loaded) is 64K for each buffer.



Note that if a sample file is no larger than two buffer sizes then the entire file will be buffered at the start of playback and if early closure is enabled (see PlayIt_Config 0) the file will be immediately closed. Thus setting a buffer size at least half the size of a sample file will cause playback to operate entirely from memory.



When changing buffer size from the default one should be aware of the potential problems;

Too small a buffer will cause breaks in the sound when the buffer cannot be refilled in time (eg when SWIs take a long time to execute).

Too large a buffer will, depending on the interface for the medium containing the sound (eg IDE, SCSI), cause sound glicthes because of the large read-from-disc operation that can disrupt sound interrupts.


[ Parent ] [ Manual root ]


Created by SHtoHTML v1.20