Jump to content

music speed


Faw[Ful]

Recommended Posts

I try to change my music speed with :

setSoundSpeed ( song, 50 )

in a classic music script, but It change nothing. :|

function startMusic() 
    setRadioChannel(0) 
    song = playSound("music.mp3",true) 
    setSoundSpeed ( song, 50 ) 
    outputChatBox("Toggle music on/off using M") 
end 
  
function makeRadioStayOff() 
    setRadioChannel(0) 
    cancelEvent() 
end 
  
function toggleSong() 
    if not songOff then 
        setSoundVolume(song,0) 
        songOff = true 
        removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) 
    else 
        setSoundVolume(song,1) 
        songOff = false 
        setRadioChannel(0) 
        addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) 
    end 
end 
  
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) 
addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) 
addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) 
addCommandHandler("musicmusic",toggleSong) 
bindKey("m","down","musicmusic") 

This is a test ! And the test fail for now xD ! :P

If it work I will slow down the music when the gamespeed change. :)

Thanks in advance.

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