- Documentation
- Sound (client)
Category
Sound (client)
All Lua functions and events in the Sound (client) category, on the server and the client.
Client functions 27
getWithout a bank number it returns the number of banks in the container. With a bank number it returns the number of sounds in that bank.SFXBank Sound Count getChecks whether a game audio container exists. The sound files are always in the game; whether a given bank will play is told bySFXStatus isSFXBankLoaded.getReturns an effect's current parameters: name → value.Sound Effect Parameters getReturns a table of all of a sound's effects: effect name →Sound Effects true/false.getReturns the volume the player actually hears: after distance from the camera and after the volume slider in the settings.Sound Heard Volume getReturns the sound length in seconds.Sound Length getReturns the distance from which a 3D sound can no longer be heard.Sound Max Distance getReturns a 3D sound's full-volume distance.Sound Min Distance getReturns the current playback position in seconds.Sound Position getReturns all playing sounds created by scripts.Sounds getReturns the playback speed.Sound Speed getReturns the volume set by script (ignores distance and the player's slider).Sound Volume isChecks whether the game has a sound bank loaded right now. Only such a bank plays throughSFXBank Loaded playSFXandplaySFX3D.isChecks whether a sound is paused.Sound Paused playPlays a sound from San Andreas' own sound banks (footsteps, weapons, collisions, vehicles, mission sounds) with no position in the world. The game's sound engine plays it, so it follows the game's effects volume.SFX playPlays a sound from the game's banks at a point in the world. The game's sound engine handles fading with distance and panning.SFX3 D playPlays an MP3 or WAV file from a resource with no position in the world (it sounds the same everywhere). The file must be listed inSound meta.xmlas a<file>.playPlays a sound at a point in the world. It fades with distance from the camera: full volume up to 5 m, silent from 20 m. It is panned left-right.Sound3 D setTurns an effect on or off for a sound fromSound Effect Enabled playSound/playSound3D. Available effects:chorus,compressor,distortion,echo,flanger,gargle,i3dl2reverb,parameq,reverb(as in MTA) andbandpass(a pass band, e.g. a voice over the phone).setSets a parameter of an effect, even one that is off. Names and ranges are as in MTA (e.g.Sound Effect Parameter echo:wetDryMix,feedback,leftDelay,rightDelay,panDelay;reverb:inGain,reverbMix,reverbTime,highFreqRTRatio);bandpass:lowCut,highCut,gain.setSets the distance from which a 3D sound can no longer be heard (20 m by default).Sound Max Distance setSets the distance up to which a 3D sound plays at full volume (5 m by default). The maximum distance grows if needed.Sound Min Distance setPauses or resumes a sound.Sound Paused setSeeks the sound to the given second.Sound Position setSets the playback speed.Sound Speed 1is normal; a higher value speeds up and raises the pitch.setSets the sound volume.Sound Volume 1is normal, up to2amplifies.stopStops a sound and removes it. FiresSound onClientSoundStoppedwith the reason"destroyed".