Maffe811 Posted June 12, 2012 Share Posted June 12, 2012 Is this possible through AutoIt? Cause when i play music with my speakers i would like grooveshark to be at 100% but games and other stuff to be at 20%-40% And then if my friends call on skype i would plug in my headphones and set games to 80%, skype to 100% and music to 10%-20% I searched around but didn't find much. Any suggestions ? [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
JohnOne Posted June 12, 2012 Share Posted June 12, 2012 I imagine you would have to code each individual app to altear its volume then code some preset functions to alter them. Unless that is, you know of a way to manually do this through just windows. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Maffe811 Posted June 12, 2012 Author Share Posted June 12, 2012 I imagine you would have to code each individual app to altear its volumethen code some preset functions to alter them.Unless that is, you know of a way to manually do this through just windows.Hmm, there is this Speaker icon, and if i click that there is a thing called mixer... But... Do i have to slide te sliders to slide the volume up and down?Is there a way to _VolumeMixerSet($Program, $Volume) ?This is what i would like to end up with ^I just feel that since im doing this quite often makes it a great candidate for being automated to a button press. [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
Decipher Posted June 12, 2012 Share Posted June 12, 2012 What verison OS are you using? Spoiler Link to comment Share on other sites More sharing options...
Maffe811 Posted June 12, 2012 Author Share Posted June 12, 2012 Win 7 x64 [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
Decipher Posted June 12, 2012 Share Posted June 12, 2012 Doesn't Vista+ already have support for setting volume level on a per application bases. Skype for example would added to the volume mixer. If so you could try an automate that. I seem to remember a function that could be used to set the master volume level. If such a function exists pherhaps you could study it and find a way. Spoiler Link to comment Share on other sites More sharing options...
Maffe811 Posted June 12, 2012 Author Share Posted June 12, 2012 Also, if a skypecall is accepted or made, skype turns down other sources of sound. So it can't be that hard to do this! Ill see what i can figure out. [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
Decipher Posted June 13, 2012 Share Posted June 13, 2012 I haven't tried this program personally but it seems legit. http://www.reallyeffective.co.uk/archives/2009/07/08/sound-control-v248-beta-an-alternative-freeware-windows-sound-mixer-applet-has-been-released/Quote: Added – Application – Options – Five applications can now be specified in Other Hot Keys. Spoiler Link to comment Share on other sites More sharing options...
Maffe811 Posted June 14, 2012 Author Share Posted June 14, 2012 I just noticed that the volume on steam hasn't changed for the last 3 reboots. Which mean that the voulme level must be saved somewhere! Right ? ... [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
Decipher Posted June 14, 2012 Share Posted June 14, 2012 (edited) The function I was thinking of before is:SoundSetWaveVolume(100)This is from the help file: RemarksThis controls the Wave volume, not the master volume control. Also, a value of Zero does not set mute status.On Windows Vista, there is no system-wide wave volume. This function only changes the wave volume for the script. It can not be used to change the wave volume of other programs.So it wouldn't be helpful to you, sorry. Edited June 14, 2012 by Decipher Spoiler Link to comment Share on other sites More sharing options...
Maffe811 Posted June 14, 2012 Author Share Posted June 14, 2012 (edited) I haven't tried this program personally but it seems legit. http://www.reallyeffective.co.uk/archive...ws-sound-mixer-applet-has-beenQuote: Added – Application – Options – Five applications can now be specified in Other Hot Keys.Tried this.Did the quote thing.Its only to open a program with a hotkey... Edited June 14, 2012 by Maffe811 [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
Maffe811 Posted June 14, 2012 Author Share Posted June 14, 2012 The function I was thinking of before is: SoundSetWaveVolume(100) This is from the help file: Remarks This controls the Wave volume, not the master volume control. Also, a value of Zero does not set mute status. On Windows Vista, there is no system-wide wave volume. This function only changes the wave volume for the script. It can not be used to change the wave volume of other programs. So it wouldn't be helpful to you, sorry. Anyone who can rewrite this to SoundSetWaveVolume($Volume, $ProgramHandle) ? [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
Decipher Posted June 14, 2012 Share Posted June 14, 2012 (edited) "winmm.dll" contains the functiontionallity that your looking for. Please verify that your system has this DLL and its version.Look at this UDF designed for XP: I'm particularly interested in these functions:expandcollapse popupFunc _SetMixerVolume($MixerDevice, $percent) ;default mixer is always 0 (so far) which is last audio device installed or prefered deviced selected by user SetExtended(10) $curmixer = 0 Const $MM_MIXM_CONTROL_CHANGE = 0x3D1 Const $CALLBACK_WINDOW = 0x10000 OpenAllMixers($mixers) If @error Then Exit $hmxobj = MixerOpen($curmixer, 0, $MM_MIXM_CONTROL_CHANGE, BitOR($CALLBACK_WINDOW, $MIXER_OBJECTF_MIXER)) GetMXWaveoutID($mixers, $curmixer, $MixerDevice) _SetVolume($mixers, $curmixer, $percent) MixerClose($hmxobj) CloseAllMixers($mixers) SetExtended(1) Return(@extended) EndFunc ;==>_SetMixerVolume Func OpenAllMixers(ByRef $mixers) Local $i, $mxnumdevs, $hmxobj $mxnumdevs = mixerGetNumDevs() If $mxnumdevs Then ReDim $mixers[$mxnumdevs + 1][$AMIX_SIZEOF] For $i = 0 To $mxnumdevs - 1 $hmxobj = MixerOpen($i, 0, 0, $MIXER_OBJECTF_MIXER) If @error Then SetError(1) Return False EndIf $mixers[$i][$MIX_HMXOBJ] = $hmxobj Next ;i EndIf $mixers[0][0] = $mxnumdevs EndFunc ;==>OpenAllMixers ;On ENtry: mixer id and flag(s) , if no id passed then the preffered id is used (0) ditto for flag ;on exit: mixer handle Func MixerOpen($uMxid = 0, $hwnd = 0, $instance = 0, $fdwOpen = 0) Local $x, $h_struct $h_struct = DllStructCreate("udword") ;since a local will be deleted on exit of function If @error Then SetError(1) Return False EndIf $ret = DllCall("winmm.dll", "long", "mixerOpen", "ptr", DllStructGetPtr($h_struct), "int", $uMxid, "int", $hwnd, "int", $instance, "int", $fdwOpen) If Not @error Then If $ret[0] <> $MMSYSERR_NOERROR Then Return -1 $x = DllStructGetData($h_struct, 1) Return $x EndIf SetError(1) Return False EndFunc ;==>MixerOpen Func CloseAllMixers($mixers) Local $i, $cnt $cnt = $mixers[0][0] For $i = 0 To $cnt - 1 MixerClose($mixers[$i][$MIX_HMXOBJ]) Next ;i EndFunc ;==>CloseAllMixers ;On Entry: mixer handle Func MixerClose($hmxobj) $ret = DllCall("winmm.dll", "long", "mixerClose", "long", $hmxobj) If Not @error Then Return True Return False EndFunc ;==>MixerClose Func mixerGetNumDevs() $ret = DllCall("winmm.dll", "long", "mixerGetNumDevs") If Not @error Then Return $ret[0] SetError(1) Return False EndFunc ;==>mixerGetNumDevsOpenAllMixers() seems to return an array of mixers. You should be able to set them individually. One good question here is how to identify the mixer that you want the volume level to be set.Other Info:Volume Mixer: %windir%System32SndVol.exe -r 49490633Waveform Audio ReferenceAnother Utility: http://blog.nirsoft.net/2011/02/25/how-to-control-the-volume-level-of-specific-application-from-command-line-on-windows-72008vista/Download Page: http://www.nirsoft.net/utils/nircmd.htmlDownload Links:NirCmd.zipNirCmd-x64.zip Edited June 14, 2012 by Decipher Spoiler Link to comment Share on other sites More sharing options...
Maffe811 Posted June 14, 2012 Author Share Posted June 14, 2012 ;=============================================================================== ; ; Internal Functions ; ;=============================================================================== That ^ but ill look into it.. [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
Decipher Posted June 14, 2012 Share Posted June 14, 2012 With some will and research those internal functions from the XP Audio UDF should allow you to set the volume per application from AutoIt. If it was easily done and didn't require much thought then it usually wasn't worth doing in my experience. Experiment with using DllCall in AutoIt and you'll learn for the next time you encounter a problem that requires it. Honestly, I've not actually implemented such code in a script myself but I'm sure you can figure it out. I'll help you if I can. Spoiler Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now