05-13-2009 03:41 AM
Im trying to build a VI that will play a pre-recorded sound, with the ability to pause, play in reverse and skip to any part of the sound data and continue playback. (Play in reverse would be a nice feature but really doesn't need to be there). Once I have figured out the procedure, it will be integrated with video playback and logged data display, so it needs be fairly dynamic as far as loop time when adding to the output buffer.
I have what I thought should work (written in LABVIEW 8.6) only I am finding that the "sound output write" vi is not acting as expected. My interpretation of the documentation for this vi is that when you input data to this vi (with zero timeout wired in), it should dump that data onto the output buffer then return to the main program while that data is being played. However, I am finding that this does not happen and that the vi takes at least as long to complete as it takes to play the data. The rest of the vi is completed in less than a millisecond so it is definitely this vi that is taking all of the time. This is causing the sound to be very clicky and sometimes doesn't even resemble a sound-wave.
Am I using the VIs wrong? is there a better way to go about achieving this? The VI I have written is attached. If the sine wave signal is set to 500Hz it sounds fine as the sample frequency is a multiple of this (Im not exactly sure why it works). If I have the sine wave signal set to 501Hz or 510Hz for example, you hear the problem I described above.
Solved! Go to Solution.
05-13-2009 04:12 AM
Just a suggestion.,
You might try windows media player activeX control. Just load the file you want play using the property nodes of the activeX control and it does the remaining job.
I am jus testing the vi you have attached and will post back if i got any ideas.
05-13-2009 04:59 AM
hi,
why dont you use sound pause function?
Gaurav k
05-14-2009 09:54 PM - edited 05-14-2009 09:55 PM
05-18-2009 09:45 AM
Hello Mark,
The Vision Acquisition Software currently does not offer the functionality to record audio along with video to an AVI file. I would look at third-party software that you could call from within LabVIEW that would enable you to integrate the audio portion of the AVI file. LabVIEW does have the ability, however, to save the array of values you receive from the DAQ card to a .wav file, and the video to a .avi file.
05-18-2009 10:15 AM
It is a well known problem that the Labview sound output system is not very good in 8.x. The sound system in 8.x do not support buffers. It did so in 7.1 but was removed in 8.x. NI have recognized it as a problem. But are not interesting in fixing it. They have chosen to ignore it instead.
I think if you are running XP you may use the old sound system. You can find more about it here
http://forums.ni.com/ni/board/message?board.id=170&message.id=403131&query.id=397064#M403131
This may also help you http://www.zeitnitz.de/Christian/index.php?sel=waveio. I use this a fix