Hi MGS!
MGS writes:
> How can I play a continuous, repeating waveform using SO VI's (that
> isn't choppy)? I gather that I need to buffer the waveform, and I see
> examples using AO VI's, but how do you buffer using SO Write? What
> are Circular Buffers and might I use this technique to solve my
> problem?
>
I've tried to do the same, i.e. synthesize a wave for continuous,
non-choppy output, and have some un-solved problems.
A buffer is sent to SO Write, which is then transfered to the device
driver and the sound output hardware. The problem is how to refill the
buffer that is sent SO Write, before the internal buffers of SO Write
and/or the device driver or hardware empties their buffer, which would
result in silence. We need a warning that the buff
er is almost empty,
so that more samples can be constructed. I've found no way to do that
using LabView 5.1.
However, we now how fast samples are consumed, so they can be produced
at the same rate, or perhaps a little faster. If they are produced
much faster, the memory will fill up, but if the difference is small,
the program can run for quite a while. It was a year ago, or so, that
I did this, so I don't remember the details.
A circular buffer can be used in a multi-thread producer-consumer
program. I've done it in C and C++, from some tutorial I found on
threads, or maybe it was from the OSS (open sound system) for
Linux. It is a buffer with a write position and a read position. The
addresses wraps around, so it works a bit like a conveyor belt. The
writer must check that the buffer is non-full, and the reader that it
is non-empty. I'm not sure how to implement it i LabView, or if it's needed.
--
Helge Stenstrom
h.stenstrom@ieee.org