12-19-2011 06:15 PM
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
12-20-2011 03:08 PM
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
12-20-2011 03:11 PM
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
12-21-2011 10:55 AM
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
12-21-2011 11:13 AM
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.