Set Volume - Forum

Forum Navigation
You need to log in to create posts and topics.

Set Volume

I put a simple volume command into a button.

SetVolume "Master" "126"

And it doesn't do a thing with my volume.

What am I overlooking?

Thanks.

@rcohen

I do not have experience with this particular command, but decades ago, when the neoDX plugin was introduced, it was discovered that the volume was calibrated on a logarithmic (as opposed to linear) scale ... this is because sound is measured in decibels, which like the Richter scale (earthquakes) is a logarithmic scale.

If the same is true of this command, this means the value of 126 (about halfway between 0 and 255) will not produce sound at half the maximum value.

Try experimenting with a value of 254 ... and work your way down ... you should experience a steep reduction in sound before you reach about 235.

If not, this is a different problem; perhaps you can use GetVolume to see what number is being returned.

wow I surely hope this isn't the case, as then we'd not have very tight control over the volume....   I'll give that a test run though to find out if that's the case.

Thanks @gaev

@gaev,

I tried what you suggested (set to 245) and again.... no response.

It must be something other.

@luishp, any tips?

Thanks

Quote from rcohen on November 3, 2022, 3:49 am

I put a simple volume command into a button.

SetVolume "Master" "126"

And it doesn't do a thing with my volume.

What am I overlooking?

Thanks.

@rcohen

I don't think SetVolume changes the Windows System Volume, it changes the volume of the file being played or audio device being used, relative to the the current Windows System Volume that has been set, but within the program when it's run.

Example:
Create a button, add the command PlaySoundFile in Actions, then pick any audio file (mp3/wav) to play when pressed.
Add a Track Bar, with min "0", max "255", int "126".
Add - SetVolume "Master" "[TrackBar1]" - in Track Bar Actions, Value Changing option.
Play the audio file and move the trackbar up and down, the volume should then change accordingly.

I found these VBScripts. You could create 3 functions and Call them, these will then control the Windows System Volume on each button press.

Increase volume:
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys(chr(&hAF))

Decrease volume:
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys(chr(&hAE))

Mute:
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys(chr(&hAD))

 

luishp has reacted to this post.
luishp

Thanks for the information @paultomo

.   I'll just seek a plugin for this ...  I'm not very versed at using VB scripts... I can never get them to work LOL.

 

 

@rcohen, try this sample. Greetings

Uploaded files:
  • You need to login to have access to uploads.
luishp and rcohen have reacted to this post.
luishprcohen

Thanks @impactband4u,

I will check this out.  Meanwhile we were using Zaeems SmartObjects plugin which features a volume linked trackbar object.

 

Appreciate the pub, thank you.

Hi @rcohen

I also ran into the Volume problem from Windows 7.

I solved it by using some volume up and down functions and the RACAutoIt3x_V10 plugin to use the MUTE/UNMUTE option.

The functions and the plugin are from ROMAN AVALOS CASTILLO.

I put a link with everything you need and an example PUB. It works perfectly on Windows 10 and 11.

Volumen_Win10.zip

Vadim and rcohen have reacted to this post.
Vadimrcohen

Thanks @cn_iceman

This is actually for another Neo user who I'm trying to assist, and so I will pass this to him.   Thanks again... much appreciated.

I do not know if it's possible @luishp, but perhaps you can add a function to control system volume in the next release?  It would be great to not have to rely on a plugin to set system volume.

Thanks (everyone) for assisting.  Much appreciated.

 

@CN_Iceman

Very nice solution!

I was wondering, is there any way to do something similar with the Microphone input level?

Sorry... Unfortunately, I haven't found a solution for that problem yet.

Greetings.