Jump to content

.au3 vs. .exe question


Recommended Posts

When I run this code as a script (F5 in SciTE) or compiled (with Aut2exe) the output (by MsgBox) is different. Now I'm running this under MS Vista, and I know that it probably won't run correctly, in fact it doesn't, but my question is why are the two outputs different? For more info, when run as a script, both functions output 49, and the compiled code outputs 100 (both functions).

#include <Audio.au3>
_SoundGetMasterVolume()
_GetMixerVolume(0)
MsgBox(0, "", "SoundGetMasterVolume() = " & _SoundGetMasterVolume() & @crlf & "GetMixerVolume(0) = " & _GetMixerVolume(0))

Thanks,

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

  • Moderators

If you put #RequireAdmin at the top of your script then compile, what output do you get then?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Vista has per-application audio settings. Chances are, you've set the AutoIt3.exe sound settings to 49 and Vista has remembered this. When you compile the script into an EXE Vista considers it a different application with it's own audio settings. This different (compiled) application has not changed the volume.

My comments are making a lot of assumptions. I do not know exactly how Vista's audio system works nor do I know if it stores the volume settings across separate runs of the same program. If Vista does save and restore the per-application audio settings and Vista does behave how I think with true audio settings isolation then your results are expected.

Link to comment
Share on other sites

If you put #RequireAdmin at the top of your script then compile, what output do you get then?

Same thing. FWIW, the account I created and executed the script in is an admin account, I'm going to create a regular public account and try it again.

Just to make sure I'm getting this across, I am aware of audio/sound problems with Vista, and I'm not trying to get this to work in Vista (well that would be nice, and I am going about it in different ways..), but I asked the question initially to ask why the difference between the au3 and an exe..

Edited by snowmaker

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...