SetSoundProperties: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
{{Client function}} | {{Client function}} | ||
{{New feature/item|3.0130|1.3.0|4097| | {{New feature/item|3.0130|1.3.0|4097| | ||
This function | This function edits the properties of a specific [[sound]]. | ||
}} | }} | ||
{{Note|Streams are not supported.}} | |||
==Syntax== | ==Syntax== | ||
Line 40: | Line 41: | ||
[[hu:setSoundProperties]] | [[hu:setSoundProperties]] | ||
[[ar:setSoundProperties]] | [[ar:setSoundProperties]] | ||
[[ro:setSoundProperties]] |
Latest revision as of 09:42, 3 March 2019
This function edits the properties of a specific sound.
Syntax
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
- sound: a sound element that is created using playSound or playSound3D
- fSampleRate: a float that defines the new sound's sample rate
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
Returns true if the properties sucessfully set, false otherwise.
Example
Click to collapse [-]
Clientfunction 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 end addEventHandler("onClientResourceStart", resourceRoot, editSongSound) -- Execute the function when the resource is started
See Also
- getRadioChannel
- getRadioChannelName
- getSFXStatus
- getSoundBPM
- getSoundBufferLength
- getSoundEffectParameters
- getSoundEffects
- getSoundFFTData
- getSoundLength
- getSoundLevelData
- getSoundMaxDistance
- getSoundMetaTags
- getSoundMinDistance
- getSoundPan
- getSoundPosition
- getSoundProperties
- getSoundSpeed
- getSoundVolume
- getSoundWaveData
- isSoundLooped
- isSoundPanningEnabled
- isSoundPaused
- playSFX3D
- playSFX
- playSound3D
- playSound
- setRadioChannel
- setSoundEffectEnabled
- setSoundEffectParameter
- setSoundLooped
- setSoundMaxDistance
- setSoundMinDistance
- setSoundPan
- setSoundPanningEnabled
- setSoundPaused
- setSoundPosition
- setSoundProperties
- setSoundSpeed
- setSoundVolume
- stopSound
- Shared
- playSoundFrontEnd