Sign in to follow this  
Followers 0
Champak

Soundsetwavevolume bug?

10 posts in this topic

I'm using this and its changing the position of the bar of the app on the mixer screen, however the actual audible volume level doesn't change until I actually click on the volume bar itself...not manually move the bar, just simply click it as if I'm activating it after this function actually moved it. In case it matters, I have my master volume set to half (I know this feature doesn't act on the master volume).

Windows 7 and the latest stable version of autoit.

Can anyone else verify this happens to them? Any thoughts?

Share this post


Link to post
Share on other sites



Works for me with this code, (launched in x64 an x86)

Run("sndvol.exe")
;Run("sndvol32.exe")

For $i = 0 To 100 Step 20
    Soundsetwavevolume ($i)
    SoundPlay(@WindowsDir & "\media\tada.wav", 1)
Next

Windows 7 Pro SP1 x64 / AutoIt 3.3.10.2

Share this post


Link to post
Share on other sites

Read the help file regarding Windows Vista, maybe thats your problem

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I found the "problem", however it does seem like a bug to me if I understand correctly how this function is supposed to operate.

; SoundPlay("C:\Users\Lab\Music\Test\One Me.mp3")


 $OPLAYER2 = ObjCreate("wmplayer.ocx")
 $OPLAYER2.url = "C:\Users\Lab\Music\Test\One Me.mp3"



For $i = 0 To 100 Step 10
    Sleep(2000)
    Soundsetwavevolume ($i)
Next


It seems that the volume doesn't want to respond without clicking the bar if the audio is being produced by wmp object. It works fine with soundplay. Is this because in the back end soundplay and soundsetvolume work with a different engine than wmp so to say? But even if that is the case, why would the volume bar move while the wmp object is playing with no audible volume change?

Edited by Champak

Share this post


Link to post
Share on other sites

You can only change the volume for the script that's running. You can NOT change the volume of another program using that function, you can NOT change the master volume of the computer using that function either.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Where do you see me trying to change the master volume, or mention the master volume? The script example shows what I'm doing. It's all the same script I'm trying to affect.

Share this post


Link to post
Share on other sites

Any thoughts on a workaround?

Share this post


Link to post
Share on other sites

i would think that your loop would be a workaround to this if this didnt work, but it does  :)

For $i = 0 To 100 Step 10
    $OPLAYER2.settings.volume = $i
    Sleep(2000)
Next

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Doing that is fine for the actual media player portion of the app, but here is the problem.

1/ I'm also using text to speech object in the app which is strictly based on the mixer volume level.

2/ even if I use that to set the actual wmp volume, the overall wmp volume is subject to the volume level of the app set in the mixer. Think of it like the mixer is the amp gain and the wmp volume is the stereo volume. If the amp gain is changed everytime you turn on the radio it will mess everything up.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Wouldn't you just set the voice volume with the sapi object?

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
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
Sign in to follow this  
Followers 0