04-21-2010 03:13 PM
Hi,
For some reason "Play Sound File.vi" in LabVIEW 2009 SP1 x64 will not playback my .wav files on Windows 7 x64 Ultimate. It gives this error:
LabVIEW: (Hex 0x12C3) The sound driver or card does not support the desired operation.
The exact same code does work (it will play .wav files) with LabVIEW 2009 SP1 x32 on Windows 7 x32 Home Premium.
Here are the results of the test cases I tried so far:
Box 1: Dell Precision T3400, Windows 7 x64 Ultimate, LabVIEW 2009 SP1 x64 [does not work]
Box 2: Dell Optiplex 755, Windows 7 x64 Ultimate, LabVIEW 2009 SP1 x64 [does not work]
Box 3: Lenovo X100E Netbook, Windows 7 x32 Home Premium, LabVIEW 2009 SP1 x32 [works]
The "Beep.vi", however, does work on all three machines. The sound devices on all three machines work fine when used by other non-LabVIEW applications.
I also tried several different .wav files, including ones stored in C:\Windows\Media. None of them will playback in LV on Box 1 or Box 2.
The user account I'm using even has Administator privileges on all 3 boxes.
Anyone else experience this? How do I resolve it? I tried digging into "Beep.vi" to see if I could reuse any subvis, but Beep.vi is password protected.
Thanks,
Richard
Solved! Go to Solution.
04-21-2010 04:02 PM
If it were me, I'd start with the DLL that the VI calls: C:\Program Files\National Instruments\LabVIEW 2009\resource\lvsound2.dll. Maybe you could try using the older file, lvsound.dll.
If I just wanted a way around this problem, I'd consider using ActiveX calls to run the windows media player instead...
04-22-2010 11:28 AM
I got wav files to play by calling the PlaySound method contained in C:\Windows\System32\winmm.dll.
Had to create a Call Library Function and lookup the interface to PlaySound.
The VI is attached to this post.
01-14-2013 03:09 PM
I leave an example which can contribute, greetings SO-W7 64bit
06-08-2013 06:22 AM
Thank you for that. This whole thing's been bugging me since last week.
Now, how does the VI declare an 'end of file'?
06-08-2013 09:21 AM
By that I mean how do I get the Call Library node to output a boolean value when the end of file is reached?
05-09-2014 12:09 PM
Hahis d tproblem in LabVIEW 2013 64 bit. This VI solved the problem. NI should note this and update the example program. I have a service request in #7407862.
01-21-2015 11:09 AM
Greg,
The link to the VI does not work. Can you tell me what the change was?
Jon
01-21-2015 12:18 PM
JonP,
Including this Service request post because I forgot what this was all about. Also I don't know where this replacement VI came from, probably these forums. anyway this worked on LV2013 and 14 64 bit
This is Corey in Applications Engineering at National Instruments. I've brought the play sound vi x64 issue to some of our Product Support Engineers. This problem is associated with the windows API being updated. The LabVIEW example, playsound.vi, was created sometime ago and has never been updated to use the new windows API call as documented in this knowledge base article:
"Why Does My Project Search for the lvsound.dll Library When Opened?"
http://digital.ni.com/public.nsf/allkb/E3760A2A21C087DE86257CD00063C4B0?OpenDocument
To sum it all up: To correct this, you will need to modify your code and replace functions from the old sound API with functions from the new API. This will change your program to make calls from lvsound2.dllinstead of lvsound.dll.
The original API VIs have remained in vi.lib for compatibility purposes only, but not in the palettes. As far as future x64 support goes, it is the direction LabVIEW is headed and we do have internal documenation that updates this for future releases.
05-01-2017 03:01 PM - edited 05-01-2017 03:02 PM
play_sound_file2.vi works for me (Win7, x64, LV2014). Thanks.