Jump to content

Soundsetwavevolume bug?


Recommended Posts

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?

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...

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

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

Link to comment
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.

Link to comment
Share on other sites

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

Edited by boththose

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

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...