LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

status of sound play

Hi,

We are trying to output sound to the computer's sound card continuously from say a continuously sampled analog signal. We recognize that there are two clocks involved here, a A/D sampling clock and a clock (on the sound card) for outputting the sound. Despite our efforts, the two clocks are going to be slightly different. In order to use some resampling technique to compensate for the constant frequency difference, we need to know the status of the sound playing, i.e. how many samples are already played from the buffer written using the sound output write vi. Does anyone know how to obtain this status ? Or does anyone have any ideas how to output sound continuously without buffer underrun or overrun ?

Thanks

0 Kudos
Message 1 of 5
(2,497 Views)

Hi sv123,

 

Labview has a vi called Sound Output Info.vi. It returns information about the current state of a sound output task. I'm not sure what version of Labview you are using, but this link has more information about this vi as well as information where you can find an example. 

 

Regards,

Travis ann

Customer Education Product Marketing Manager
National Instruments
0 Kudos
Message 2 of 5
(2,474 Views)

Hi,

We looked at this VI but this VI does not tell us how much of the sound buffer is played out and how much is remaining. Is there someway of finding this out ? We are using LabView 2011.

Thanks

0 Kudos
Message 3 of 5
(2,470 Views)

Hey sv123,

 

I'm sorry about that. What about sound file info.vi? It returns the total number of samples per channel in the wave file. 

 

Regards,

Travis Ann

Customer Education Product Marketing Manager
National Instruments
0 Kudos
Message 4 of 5
(2,457 Views)

Hi sv123,

 

I'm not 100% sure on this, however I believe statistics like this would be idiosyncratic to the soundcard that you're constructing an interface with. This would mean that driver specific API would need to be called in order to gather the information you require, so your best bet may lie with using the Call Library Function Node or a .NET Constructor Node from the Connectivity palette within LabVIEW alongside some knowledge of the driver's internal structure.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 5 of 5
(2,451 Views)