03-14-2012 09:30 AM
Hello All,
I'm trying to save a wav file at a press of a button on/off with automated name files.
The idea is the VI is running, displaying data when the save button is pressed data are saved as wav until the button is pressed again. The filename are generated with date and time automatically. The user can create as many save as he/she wants without stopping the VI.
As you can guess I'm not a good labview programmer and I'm having a problem as my VI doesnt work properly. The saved wav file returned are huge they seems to retain too many data basically. When i play it back it sound looped. I understand the problem comes from my VI. Believe me I've been trying and trying with no luck. Could someone have a look please and let me know what is wrong. I do not understand how to make the saving part of my VI work.
Please find attached my VI.
Thank you in advance for your help.
Frederic.
Solved! Go to Solution.
03-15-2012 09:32 AM
Done it 🙂 . Yay.
03-15-2012 09:38 AM
Posting what you did to solve the problem would help others in the future
03-15-2012 09:48 AM
Hello Frederic,
I think I can see what is going wrong.
In the bottom loop, you keep writing 'Filtered Signal' to your file regardless of whether it has changed value. This is why when you play it back you get looping sound.
If I was you, I wouldn't worry about saving to file in a separate loop. If you did want to do this, you would have to implement some kind of queue based producer/consumer architecture. (this may still be necessary if writing to file takes too long)
That aside, see that attached example for how you could go about it. (I haven't connected everything up just shown the idea). You need to be careful to not to create the file on every loop iteration - I think I have avoided this but you will need to check it!
Let me know if this helps
Regards,
03-15-2012 09:48 AM
looks like I was just too late!
03-15-2012 10:30 AM
Hi Nick,
Thank you for your help. Please find attched what i did which looks very similar to yours. Does it look alright to you?
Hi Chrissy,
You are right I should have posted the VI for others. Here it is:
03-15-2012 10:34 AM
Yes, our solutions are remarkably similar!
Do be careful to close off the files when you have finished writing to them - I am not sure you have done this. You have placed one close outside the loop which will only close off the most recently created file.
Regards,
03-15-2012 12:20 PM
Thanks for the feedback Nick i'll do that.
Frederic