LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sound Output Write does not allow for buffer overwriting (why not?)

I am simulating the sound of the human heartbeat with 2 waveforms (sound1 and sound2) that have a programmable delay between them that is sync'd to the actual ECG being recorded by the system. In LV8.0 I was able to do this but in LV8.2 the sound write vi's were changed and they appear to be less flexible. Since the sounds need to be sync'd to the ECG it may occur that sound1 needs to be preempted by sound2 if the ECG is fast enough. LV8.2 sound output vi's do not appear to be able to do this unless I clear the task and recreate it on every beat and this is rather inconvenient. LV8.0 SO Write vi allows you to overwrite the buffer with a new waveform and then play it. How can this be done in LV8.2?
0 Kudos
Message 1 of 4
(2,978 Views)
sachsm,

Would it be possible for you to post an example VI of what you are trying to accomplish?  I assume you are using one task but with multiple writes, correct?

I'd like to investigate further before I can propose any possible workarounds.

Regards,

Simon H
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,959 Views)
Here is a vi that uses both the old style sound output and the new LV8.2 vi's. The old style produces a nice beat sound but I cannot get the new vi's to work correctly. Thanks for your help, Mike Sachs
0 Kudos
Message 3 of 4
(2,954 Views)
Mike,

Would creating a new task for each beat not work better here?  Conceptually we are telling the sound card to forget about the previous samples we had already written and instead do something else.  This sounds like a new task to me.  The default behavior of the old (7.x) sound VIs, although perfect for your application, seems a little more constraining as you are not able to make multiple writes without overwriting prior samples.

I have added another case to your example which uses the LabVIEW 8.x sound VIs that sounds right to me (you may need to correct me here).  You could even go one step further and combine the configure and the write into a subVI to reduce clutter on your block diagram if you wanted.

Regards,

Simon


0 Kudos
Message 4 of 4
(2,938 Views)