LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

volume control of each channel with volume_control.llb

Hello everyone,

 

i want to control the volume of the right and left channel independently when i playback a mp3-file.

So the only possible solution is to use the mixerGetNumDevs.vi, mixerOpen.vi, mixerLineSetVolume.vi and the mixerClose.vi of the

volume control.llb.

What is working with the volume control.vi (of the volume control.llb) is the master volume (that means both channels have the same volume).

How can i change the settings to control the left and right channel independently.

Is there an example.vi for it?

Thank you.

 

with kind regards

 Erik

 

 

0 Kudos
Message 1 of 7
(2,215 Views)

Hi Erik,

 

where did you download the volume control.llb?

 

You could also use the Sound Output Set Volume VI.

There you have the possiblility to set different volumes for each channel.

 

Best regards,

 

Nina

0 Kudos
Message 2 of 7
(2,134 Views)

Hello Nina,

 

i downloaded the Volume Control.llb from this forum here (there is also an older version called volctrl.llb).

 

The Sound Output Set Volume VI is fine if you play wave-files, but it is not possible to use it for playing mp3 files (with the mciSendStringA function of the winmm.dll).

So the only possibility is to use the mixer functions of the winmm.dll.

 

with kind regards

  Erik

 

 

 

0 Kudos
Message 3 of 7
(2,127 Views)

Hi Erik,

go to the Numeric palette --> Data Manipulation --> Join Numbers.vi

You can use this VI to use 2 byte for left and 2 byte for right channel.

To create a 32 bit value you can use the Join Numbers.vi
I hope this was helpful for you.

Just try to configure your VI. This shouls work.

Best regards,

Nina

0 Kudos
Message 4 of 7
(2,037 Views)

Hello Nina,

 

thank you very much for your help.

I tried it, but it is not working like it should.

When i set the higher 2 bytes to 0 the volume is equal the lower 2 bytes. (But it is the main volume)

When the set the higher 2 bytes unequal 0 there is nothing happened anymore.

I fear there should be some changes more.

 

with kind regards

  Erik

 

 

0 Kudos
Message 5 of 7
(2,028 Views)

Hi Erik,

 

this seems to be a bit more difficult.

 

There are used many windows functions. I don´t know if it´s generally possible to set different volumes for both channels.

Would be the best, to ask this in a windows forum.

Maybe there is a special function.

 

Here some interesting information about the mixerline structure:

 

http://msdn.microsoft.com/en-us/library/windows/desktop/dd757305%28v=vs.85%29.aspx

 

I´m sorry, unfortunateley I have no other solution yet.

 

Have a great weekend.

 

Best regards,

 

Nina

0 Kudos
Message 6 of 7
(1,990 Views)

Thank you Nina, This method is working for me.

0 Kudos
Message 7 of 7
(1,405 Views)