LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sound Play Wavefile.vi

Hi All,
Could anyone help with this query?!
I want to use the Sound Play Wavefile.vi because it allows for asynchronous
operation -
HOWEVER - any ideas as to how you can programmatically change the volume
control so you can have asynchronous play at various levels of intensity?
Thank you:)
Sarra Miller.
0 Kudos
Message 1 of 5
(3,136 Views)
I don't think the Wavefile VIs are going to give you the capability to vary the volume on a per waveform basis. You might want to download the directX object from Microsoft and see if it has the capability. You could access it from LabVIEW by using ActiveX.

Marc
0 Kudos
Message 2 of 5
(3,136 Views)
Hi,
you may use WIN API function "waveOutSetVolume" from winmm.dll. This dll is located in windows/system or system32 dir.
Here is the description of this function from
http://www.vbapi.com/ref/w/waveoutsetvolume.html
-----------------------------------------
Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long

Platforms: Win 95/98, Win NT

waveOutSetVolume sets the volume level for a waveform output device. Depending on the capabilities of the device, this function either sets the independent left and right channel volumes or the overall volume. Each volume setting must be in the range between &H0 (silence) and &HFFFF (maximum volume). The function returns 0 if successful, or a non-zero error code if an
d error occured.

uDeviceID
Either the device identifier or a handle to the waveform output device to set the volume of.
dwVolume
The new volume setting(s) for the device. If separate left/right volumes are supported, the low-order word is the left channel volume and the high-order word is the right channel volume. If not, the low-order word contains the overall volume and the high-order word is ignored.
--------------------------------------
I've tested it on my PC and it works.

Good luck.

Oleg Chutko.
0 Kudos
Message 3 of 5
(3,136 Views)

I leave an example that can provide, use it in your program

Message 4 of 5
(2,410 Views)

STOP SPAMMING THE BOARDS!

0 Kudos
Message 5 of 5
(2,407 Views)