Jump to content

'setSoundVolume' Problem


FSXTim

Recommended Posts

Hello,

the script doesn't set the volume of the running songs to '0', what's wrong?

addEventHandler ( "playTheSound2", root, 
    function () 
        local sounds = getElementsByType ( "sound" )     
        setSoundVolume ( sounds, 0 )     
        song = playSound ( "music/party.mp3", false ) 
        setSoundVolume ( song, 2 ) 
    end 
) 

I hope you can help me.

Greets

Link to comment
addEventHandler("playTheSound2", root, 
    function() 
        for i,v in ipairs(getElementsByType("sound")) do 
            setSoundVolume(v, 0.0) 
        end 
        song = playSound("music/party.mp3", false) 
        setSoundVolume(song, 1.0) 
    end 
) 

Link to comment

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
  • Recently Browsing   0 members

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