LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Playing Wave file Using functions in winmm.dll

hi friends,
 
In my application i need to play a wave file through a sound card connected to system....using Dll's
In some website i found info that using functions in winmm.dll we can play it....
I need to give the device ID (for selection of Sound Card) as input and need to play the selected wave file...
I found one function PLAYSOUND......playing wave file through default sound card only...but i need to select the device ID...
 
Can you please Suggest me a way so that i can select Device ID...?and play the wave file...
 
Thanks and Regards,
SODLB
 
0 Kudos
Message 1 of 5
(4,734 Views)

Hello,

I'll take you a step further: Instead of using a driver from a website and trying to make your own code to play your wave file, perhaps you might consider using an example vi that bypasses this all for you. This KB describes how to use the sound out vi's to play wave files and also provides you with an example vi that follows the listed steps. Take a look. I believe this will satisfy the functionality you are seeking.

Cheers,

Emilie Kopp | Applications Engineer | National Instruments

0 Kudos
Message 2 of 5
(4,719 Views)

Oops!

Here's the KB I was speaking of.

0 Kudos
Message 3 of 5
(4,717 Views)

hi Emilie Kopp,

This is working...but can i do with DLLs....?

I have got the information regarding winmm.dll functions from MSDN....when Im using the same thing here in LabVIEW...i could not get the result..

I have followed the document provided "calling external DLL's in LabVIEW" but could not the result...

The functions Im using are WaveOutOpen,WaveoutWrite,etc....

can you provide me any examples in LabVIEW which use the functions in winmm.dll

Thanks and Regards,

SODLB

 

0 Kudos
Message 4 of 5
(4,671 Views)
Hello SODLB,
While I do not have an example that explicitly calls the winmm.dll, I can provide you with an example that might shed more light on how to call a Windows dll in general. Look here for an example vi that calls a windows dll in order to play a Windows sound. You'll should be able to encorporate the concepts in this vi into the code you will have for your specific program.
Cheers,
Emilie
0 Kudos
Message 5 of 5
(4,654 Views)