LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I play .wav files from CVI withour launching windows media player??

I need to play .wav files in relatively quick sucession. Can I play them from CVI? And if so, without lauching media player all the time?
0 Kudos
Message 1 of 4
(3,839 Views)
Hey!!

Where have the sound player demos gone???

I tried to attach them from 5.0.1, but this server won't do binaries. The
newly revised www.ni.com doesn't seem to have them either.


"zener" wrote in message
news:506500000008000000A02E0000-1003545641000@exchange.ni.com...
> I need to play .wav files in relatively quick sucession. Can I play
> them from CVI? And if so, without lauching media player all the time?
0 Kudos
Message 2 of 4
(3,839 Views)
You will need to use a 3rd party API such as the Windows SDK multimedia library or something like WMP to play the files from your CVI app. The following links provide information on what this entails. (Note: some of the examples mentioned are actually shipped with CVI.)

http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/0d4680223dcaed7b8625687b006460b3?OpenDocument

http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/9055d9b9bdd02fcb8625687b0064326e?OpenDocument

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 3 of 4
(3,839 Views)
I don't know if this is still useful, but basically all you need is to add
this from the Windws SDK

#include
..
..
..
PlaySound (strwav,NULL, SND_ASYNC); //Send sound asynchronously, cancelling
any previous sound

SND_SYNC means wait till what's playing is finished before playing this.


The ASYNC means cancel anything previously playing and start playing this.

Luis Villa
"zener" wrote in message
news:506500000008000000A02E0000-1003545641000@exchange.ni.com...
> I need to play .wav files in relatively quick sucession. Can I play
> them from CVI? And if so, without lauching media player all the time?
0 Kudos
Message 4 of 4
(3,839 Views)