Re: I/O class: how to design for special ca



On 26/01/2006, H. S. Lahman wrote:

> If I was going to use the one-time buffer approach I think I would do
> it within the CFoo implementation. Maybe something like:
[snip]

Thanks for all your discussions of this.

In the end I decided to go for the above. The buffer, with any special
requirements it may have, is owned by the object. The user buffer is
copied in, and therefore can be any length.

If profiling indicates that this is a problem, I can expose the buffer
pointer and size, and the user can fill the buffer and call the method
which outputs the buffer directly.

However, interestingly, the copy-in method seems to perform better in a
heavily loaded system (ie the sound card doesn't under-run) which seems
counter-intuitive to me as it's doing lots of short reads of the sound
file rather than a few longer reads.

--
Simon Elliott http://www.ctsn.co.uk
.



Relevant Pages

  • Re: MIDI Wavetable Technical Implementation Reference?
    ... a buffer for each stream. ... fair amount of sound card experience. ... Simple linear interpolation may ...
    (comp.music.midi)
  • Re: Matlab Sound Output/Input Time Delay Measurement
    ... timeing from the sample rate of the recorder. ... and receive using the sound card may not be determinate ... a buffer to the sound card driver and when it ... and then the mechanical delay of the transmitting ...
    (comp.soft-sys.matlab)
  • resetting buffer on /dev/dsp
    ... we have a receiver hooked up to the sound card. ... is it possible to reset the kernel input buffer on ... getting the time stamp and this introduces a lag between the nominal ... sample time and the actual sample time. ...
    (comp.os.linux.development.system)
  • resetting buffer on /dev/dsp
    ... we have a receiver hooked up to the sound card. ... is it possible to reset the kernel input buffer on ... getting the time stamp and this introduces a lag between the nominal ... sample time and the actual sample time. ...
    (comp.unix.misc)
  • resetting buffer on /dev/dsp
    ... we have a receiver hooked up to the sound card. ... is it possible to reset the kernel input buffer on ... getting the time stamp and this introduces a lag between the nominal ... sample time and the actual sample time. ...
    (comp.unix.programmer)