LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sound output with SO Write without interruption


I have written a little program that synthesizes sound. The sound samples are sent to the speaker using SO Write.vi. The program should be able to run for hours, so only a little data is sent to the output device at at time. Maybe a thousand samples. The problem is how to know when to send new data (which must be computed accordingly) without getting any interruption in the sound. It seems to me that when the SO Write.vi finishes, all data is used up, so that it's already too late to send any more data. I need to know a little bit earlier that the output device is running out of data; and the new data must be sent to the device before the output bufer is emptied completely.

Can this be made with SO Wr
ite.vi?
I'm using LabView 5.1 on Windows98
0 Kudos
Message 1 of 2
(3,061 Views)
I think I have an answer
Each time you want to play a sound you have to write it into the buffer with SOWrite and then output it with SOStart.
I modified the example Wave File Player.vi that comes with LV so that you can play a sound conditionally each time you press a button.
To use this vi:
-load the .wav file
- press play
- each time you press 'play once' the sound is played because new values are placed in the buffer.

Try to change its mechanical action to switch when pressed, the sound is played continously because the output buffer continues to fill with new values (N.B. if you leave it pressed for a long time you run out of memory!!!)

Therefore, if you have two sounds A,B to be played: during A playing you can upload the buffer with B that will be pla
yed when A finishes without interruption.

Let me know if you need more help.

Regards,

Alberto Locatelli
Message 2 of 2
(3,061 Views)