Jump to content



Photo

Volume control.


  • Please log in to reply
28 replies to this topic

#1 Diana (Cda)

Diana (Cda)

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 716 posts

Posted 26 September 2007 - 03:26 PM

Hi, over in this thread (http://www.autoitscript.com/forum/index.php?showtopic=50672&st=0&gopid=409512&#entry409512) I asked re volume. Nothing is easy to change in AI except WAV. AutoHotKey was recommended to me elsewhere to try and I actually found an extremely easy solution in their help file (that's rare for me to figure out something in a help file when it involves any sort of scripting syntax, let me tell you!! <lol>). Here are two examples of what can be achieved in AHK, both cases where we either need to get a set level of sound to a predetermined percentage and the other case where we need to modify existing sound from a certain percentage, increasing or decreasing so in other words, both positive and negative.
; AHK script - VOLUME TO A SET PERCENTAGE ; the number after the soundset is the percentage of volume to change to (the first without description is master volume, the default when nothing designated) SoundSet, 25 SoundSet, 25, WAVE SoundSet, 25, SYNTH SoundSet, 25, CD SoundSet, 25, MICROPHONE SoundSet, 25, LINE
where we can put +25 or -25, or +35 or -35, etc., etc., to whatever percentage we want.

Pls, hopefully something this easy can be added to AI in a future build! This level of ease is missing in AI currently.

Thanks much for considering this. :)





#2 YogiBear

YogiBear

    deFinitely not yoUr average bear!

  • MVPs
  • 9,860 posts

Posted 01 October 2007 - 01:09 AM

look for audio.au3 in my sig. It will do what you ask for.

#3 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,315 posts

Posted 05 January 2008 - 04:28 PM

I like this AHK very simple syntax too.
I think some sort of more general SoundSetVolume() function should be part of AutoIt (or standard UDF).
There is only SoundSetWaveVolume() now amd especially set Master volume is missing very much (lots of people asked for this).

Here are collected some links to UDFs on the forum: link

EDIT: This is bump according to this:

I've added three new subforums to help us keep track of feature requests. I've mass moved most posts into "rejected" just to start us off. If a post was moved in error and you still believe it was moved in error just bump the thread


Edited by Zedna, 05 January 2008 - 08:11 PM.


#4 thor918

thor918

    Seeker

  • Active Members
  • 42 posts

Posted 01 April 2008 - 07:36 AM

This should be added.

I want an easy way to mute the main volum, and to set the main volum.
I don't want to use sendkey method.

http://www.autohotkey.com/docs/commands/SoundSet.htm

#5 GEOSoft

GEOSoft

    Sure I'm senile. What's your excuse?

  • MVPs
  • 10,563 posts

Posted 01 April 2008 - 11:32 AM

No one seems to be aware that "SoundSet, +25, WAVE" is pretty much how we would have written that same function back in the AutoIt v2 days. We have advanced and AHK still lives in the past. And yes, I do still have AHK installed. I still check the forums there and once in a while I've even been known to revert to it. I've also been known to revert to VBS, and JS. Autoit3 has become more complex and in most cases has higher level functionality than any of the others.
GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!"

#6 therks

therks

    Witty quote

  • Active Members
  • PipPipPipPipPipPip
  • 2,163 posts

Posted 01 April 2008 - 12:31 PM

Autoit3 has become more complex and in most cases has higher level functionality than any of the others.

I agree, yet we don't have a built in function for setting the volume of non-wave devices. I think an official Feature Request in the Trac system needs to be made. It will be easier for the developers to keep track of it that way.
*Edit: And not to mention we'll get a yes or no answer on if it's going to happen.

Edited by Saunders, 01 April 2008 - 12:37 PM.


#7 GEOSoft

GEOSoft

    Sure I'm senile. What's your excuse?

  • MVPs
  • 10,563 posts

Posted 01 April 2008 - 06:04 PM

I agree, yet we don't have a built in function for setting the volume of non-wave devices. I think an official Feature Request in the Trac system needs to be made. It will be easier for the developers to keep track of it that way.
*Edit: And not to mention we'll get a yes or no answer on if it's going to happen.

Why would it have to be added to the core when there is a UDF to handle it?
GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!"

#8 thor918

thor918

    Seeker

  • Active Members
  • 42 posts

Posted 02 April 2008 - 12:14 PM

Why would it have to be added to the core when there is a UDF to handle it?


the UDF's I have seen are not complete.
non of theme can currently mute volum( there are some code around to mute, but all those are sendkey. not good enough in my book).

if you mean in can be done in a UDF as stable and multi winos compability, as it can be done with a bultin command, then I would like to hear about it.
how is it that v2 autoit had more volum control than v3 autoit?

Edited by thor918, 02 April 2008 - 12:21 PM.


#9 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,490 posts

Posted 02 April 2008 - 12:35 PM

I think Audio.au3 is what you want

#10 thor918

thor918

    Seeker

  • Active Members
  • 42 posts

Posted 02 April 2008 - 12:45 PM

I think Audio.au3 is what you want


it's a good start, but if you look at the commented lines in the script

Items to add:
1. Mute for master volume.
2. Mute for input Microphone
3. Mute for Wave
4. Balance on Master, Wave, Microphone



#11 GEOSoft

GEOSoft

    Sure I'm senile. What's your excuse?

  • MVPs
  • 10,563 posts

Posted 02 April 2008 - 07:21 PM

it's a good start, but if you look at the commented lines in the script

And setting the volume to 0 doesn't do it for you?
GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!"

#12 thor918

thor918

    Seeker

  • Active Members
  • 42 posts

Posted 02 April 2008 - 07:39 PM

And setting the volume to 0 doesn't do it for you?

nope

#13 GEOSoft

GEOSoft

    Sure I'm senile. What's your excuse?

  • MVPs
  • 10,563 posts

Posted 02 April 2008 - 09:59 PM

nope

Well I hate to say it but the vbs method is virtually the same as the AutoIt method and
This link doesn't help with mute either.
Set Volume Ctrl
Remember that the functions in the AutoIt core are really just wrappers for the Windows API, so it could take a lot more than you think to add something in.
GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!"

#14 thor918

thor918

    Seeker

  • Active Members
  • 42 posts

Posted 03 April 2008 - 08:11 AM

Well I hate to say it but the vbs method is virtually the same as the AutoIt method and
This link doesn't help with mute either.
Set Volume Ctrl
Remember that the functions in the AutoIt core are really just wrappers for the Windows API, so it could take a lot more than you think to add something in.


Well I have seen examples of mute in vbs, so it must be possible with somewhat similar api the autoit script you linked to.
http://www.experts-exchange.com/Software/M...Q_22741956.html
scroll down for website comments, you do not have to login to se comments.

they talk about this page:
http://www.pcreview.co.uk/forums/thread-1008148.php

and here is another one:
http://forums.devx.com/archive/index.php/t-117798.html
http://files.codes-sources.com/fichier.asp...eControlOCX.bas
http://nwp.ampr2.net/jnos/ProgrammingWindowsSound

Edited by thor918, 03 April 2008 - 08:22 AM.


#15 YogiBear

YogiBear

    deFinitely not yoUr average bear!

  • MVPs
  • 9,860 posts

Posted 03 April 2008 - 04:29 PM

Good links. I haven't gotten around to fixing audio.aue to include this. I've gotten some code to fix the balance thing, but the mute issue I still need to address.

#16 thor918

thor918

    Seeker

  • Active Members
  • 42 posts

Posted 04 April 2008 - 06:31 AM

Good links. I haven't gotten around to fixing audio.aue to include this. I've gotten some code to fix the balance thing, but the mute issue I still need to address.

Hey,
didn't think we get a comment from the author himself :)
I hope you will complete your UDF, complete volumcontrol is realy missed by a whole lot of people.
Thanks for your work on it!

#17 asbeer450

asbeer450

    Seeker

  • Active Members
  • 5 posts

Posted 08 April 2008 - 03:47 PM

I hope this doesn't overlap too much with what someone else might already be working on, but due to my own needs I've gone ahead and duplicated the SoundGet/SoundSet functions that AutoHotkey has on the AutoIt side. Part of the reason for doing this is because AutoHotkey doesn't allow me to access a particular component type that I need to set the volume of, and also because I really love AutoIt.

Since AutoHotkey is open source I basically just took the C code they use to implement SoundGet and SoundSet and converted it over into AutoIt script. I also converted their script for enumerating all of the sound controls on a PC into an AutoIt function named SoundQuery. I also relied heavily on code such as WiredBits' Mixer.au3 for the correct syntax of the DLL calls and their associated data structures.

The AutoIt functions don't follow the same syntax or parameter order of the AutoHotkey functions, but they do everything that the AutoHotkey functions do and even a little bit more (with the AutoIt functions you can get or set every component and control type defined in the Windows mmsystem.h header file, provided it exists on your particular PC). The documentation for the functions is included at the beginning of the file.

I haven't tested it extensively so if you find any problems with it please let me know. Please also feel free to make any changes to it and to repost your changes here. I haven't tested it on Vista yet so I have no idea whether or not that will work.

Here's the file: SoundGetSetQuery.au3

Edited by asbeer450, 08 April 2008 - 03:48 PM.


#18 therks

therks

    Witty quote

  • Active Members
  • PipPipPipPipPipPip
  • 2,163 posts

Posted 09 April 2008 - 01:30 PM

Wowie, that's huge, you must have been at that for quite a while.

#19 asbeer450

asbeer450

    Seeker

  • Active Members
  • 5 posts

Posted 09 April 2008 - 01:47 PM

Yeah, it took me about 12 hours, give or take. It was fun, though. :)

#20 YogiBear

YogiBear

    deFinitely not yoUr average bear!

  • MVPs
  • 9,860 posts

Posted 10 April 2008 - 04:04 PM

This should be combined with Audio.au3 and set to the AutoIt coding submission standard so that it may be included in the build. This is some nice work you have done.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users