03-01-2017 10:12 AM
Hello everyone,
I am having an issue while trying to play a .wav file. I want to do this in order to report an alarm.
I am using LabVIEW 2014 SP1 f3 in a 64 bits Win7 SP1 computer. The strange thing is that the Test1.vi, which is attached to this post, works as expected in every 64 bits Win7 SP1 computers. Nevertheless in a 32 bits Win7 SP1 computer a long time passes till the file can be played (40 seconds approximatelly or even more).
In order to play the file I used the Play Sound File.vi. I have realized that the problem is originated in the Call Library Function Node included in this VI (function int32_t PlaySoundFile(const int32_t devID, const LStrHandle path, const uint32_t waitDuration, uint32_t *task);). It just take ages to be executed.
All computers were recently updated with the most recent windows updates. Nevertheless the problem persists. The final .exe application will be executed in the 32 bits PC. But under the current circumstamces it will not be possible to play any sounds.
Has anyone experienced such a problem? Some advice to solve this predicament?
Any piece of information to solve this issue is highly appreciated. I also attached the .wav sound I used for my tests in a .zip file.
Best regards,
Diego Ballen
03-02-2017 07:27 AM
I suspect this has something to do with building the Executable on 64-bit Windows (with 32-bit LabVIEW) and trying to run it on 32-bit Windows.
A Silly Question -- did you install the 32-bit LabVIEW Run-Time Engine on the 32-bit Win7 machine? [Of course you did -- that's why it's a Silly Question.]
I'm assuming that the 32-bit Win7 Machine does not have LabVIEW installed. If it did, I'd suggest trying to take your code and to rebuild your Application on the 32-bit machine. I'm assuming that the Microsoft sound DLLs are different on the two versions of Windows 7, and am unsure if LabVIEW will "play nicely" without knowing which DLL is which.
Bob Schor
03-06-2017 03:58 AM
Hi Bob,
thank you very much for your answer.
I do have installed the 32-bit LabVIEW engine on the 32 bist machine. Unfortunatelly I do not have there LabVIEW installed.
I think I will try to do that and generate the .exe direct in the 32 bit machine.
The weird stuff is that after I wait for almost one minute and the sound is finally played, the other sounds are played normally. The problem is indeed just the first play.
Best regards,
Diego
03-09-2017 02:24 AM
Hello everyone,
I just installed LabVIEW in the 32 bits machine, generated the .exe of my test VI and confirmed that the problem persists. I really do not know what the root of the problem is.
The problem also occurs when I execute the Vi inside of the project where it was developed.
Best regards,
Diego
03-09-2017 12:07 PM
This is really strange. I confess that I didn't test your code earlier, but now I have. I'm running Windows 7 x64 with LabVIEW 2016 32-bit installed. When I run your program and push "Play Sound", it immediately plays the sound (maybe there is an unnoticed delay of a few milliseconds, but it goes "Bee-doo" just when I lift my finger from the Play Sound button, as expected).
Before I tried this, I tried the (simpler) "Play the Wave File" without the Event Loop around it, ignoring the Stop buttons. Of course, I barely have time to hear the sound when the program stops. But if I add a 1000-msec Wait function to keep LabVIEW running for a whole second, I hear the sound just fine.
So your code seems to be fine. If it isn't working, something may be wrong with your Windows/LabVIEW configuration.
Bob Schor