From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This function edits the properties of a specific sound.

[[{{{image}}}|link=|]] Note: Streams are not supported.


bool setSoundProperties(element sound, float fSampleRate, float fTempo, float fPitch [, bool bReverse = false ] )

OOP Syntax Help! I don't understand this!

Method: sound:setProperties(...)
Counterpart: getSoundProperties

Required Arguments

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • bReverse: a boolean representing whether the sound will be reversed or not.


Returns true if the properties sucessfully set, false otherwise.


Click to collapse [-]
function editSongSound()
	local sound = playSound("song.wav", false) -- Play the file 'song.wav' and make it play only once
	setSoundProperties(sound, 48000.0, 128.00, 440.0, false) -- Set its samplerate to 48,000 Hz, tempo to 128.00, pitch to 440 Hz and not reversed
addEventHandler("onClientResourceStart", resourceRoot, editSongSound) -- Execute the function when the resource is started

See Also