Show / Hide Table of Contents

Class Sound

Represents a sound played for the player

Inheritance
Object
Element
Sound
WorldSound
Inherited Members
Element.element
Element.Root
Element.MTAElement
Element.Type
Element.ID
Element.Exists
Element.ChildCount
Element.Parent
Element.CallPropagationEnabled
Element.SetData(String, Object, Boolean)
Element.GetData(String, Boolean)
Element.TryGetData(String, Object, Boolean)
Element.GetData<T>(String, Boolean)
Element.TryGetData<T>(String, T, Boolean)
Element.GetChild(Int32)
Element.GetChildren(String)
Element.GetByID(String, Int32)
Element.ListenForEvent(String, Boolean, String)
Element.HandleEvent(String, MtaElement, Object, Object, Object, Object, Object, Object, Object, Object)
Element.OnDestroy
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Slipe.Client.Sounds
Assembly: SlipeClient.dll
Syntax
[DefaultElementClass(ElementType.Sound)]
public class Sound : Element

Constructors

| Improve this Doc View Source

Sound(ExtraStations, Int32, Boolean)

Create an extra GTA radio station sound

Declaration
public Sound(ExtraStations station, int trackId, bool looped = false)
Parameters
Type Name Description
ExtraStations station
Int32 trackId
Boolean looped
| Improve this Doc View Source

Sound(RadioStation, Int32, Boolean)

Create a GTA radio station sound

Declaration
public Sound(RadioStation station, int trackId, bool looped = false)
Parameters
Type Name Description
RadioStation station
Int32 trackId
Boolean looped
| Improve this Doc View Source

Sound(SoundContainer, Int32, Int32, Boolean)

Create a GTA Sfx

Declaration
public Sound(SoundContainer container, int bankId, int soundId, bool looped = false)
Parameters
Type Name Description
SoundContainer container
Int32 bankId
Int32 soundId
Boolean looped
| Improve this Doc View Source

Sound(String, Boolean, Boolean)

Create sound

Declaration
public Sound(string pathOrUrl, bool looped = false, bool throttled = true)
Parameters
Type Name Description
String pathOrUrl
Boolean looped
Boolean throttled

Properties

| Improve this Doc View Source

Bpm

Gets the beats per minute of this sound element.

Declaration
public int Bpm { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

BufferLength

Gets the buffer playback length of the sound. Works only with streams.

Declaration
public float BufferLength { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

Effects

Used to enable or disable specific sound effects.

Declaration
public SoundEffects Effects { get; }
Property Value
Type Description
SoundEffects
| Improve this Doc View Source

Length

Get the playback length

Declaration
public float Length { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

LevelData

Get the left/right level from this sound

Declaration
public Tuple<int, int> LevelData { get; }
Property Value
Type Description
Tuple<Int32, Int32>
| Improve this Doc View Source

MetaTags

Used to get the meta tags attached to this sound. These provide information about the sound, for instance the title or the artist.

Declaration
public SoundMeta MetaTags { get; }
Property Value
Type Description
SoundMeta
| Improve this Doc View Source

Pan

Get and set the pan level of this sound element. (-1.0 (left) to 1.0 (right))

Declaration
public float Pan { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

Paused

Get and set if the sound is paused

Declaration
public bool Paused { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Properties

Get the properties of this sound

Declaration
public SoundProperties Properties { get; }
Property Value
Type Description
SoundProperties
| Improve this Doc View Source

Speed

Get and set the speed of this sound

Declaration
public float Speed { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

TrackPosition

Get and set the position in seconds on the sound track

Declaration
public float TrackPosition { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

Volume

Get and set the volume. Range is from 0.0 to 1.0. This can go above 1.0 for amplification.

Declaration
public float Volume { get; set; }
Property Value
Type Description
Single

Methods

| Improve this Doc View Source

Destroy()

Stop and destroy this sound

Declaration
public override bool Destroy()
Returns
Type Description
Boolean
Overrides
Element.Destroy()
| Improve this Doc View Source

GetFftData(Int32, Int32)

This function gets the fast fourier transform data for an audio stream which is an array of floats representing the current audio frame.

Declaration
public float[] GetFftData(int iSamples = 512, int iBands = 0)
Parameters
Type Name Description
Int32 iSamples
Int32 iBands
Returns
Type Description
Single[]
| Improve this Doc View Source

GetSfxStatus(SoundContainer)

Check if a soundcontainer is available on this client

Declaration
public static bool GetSfxStatus(SoundContainer container)
Parameters
Type Name Description
SoundContainer container
Returns
Type Description
Boolean

Events

| Improve this Doc View Source

OnBeat

Declaration
public event Sound.OnBeatHandler OnBeat
Event Type
Type Description
Sound.OnBeatHandler
| Improve this Doc View Source

OnDownloadFinished

Declaration
public event Sound.OnDownloadFinishedHandler OnDownloadFinished
Event Type
Type Description
Sound.OnDownloadFinishedHandler
| Improve this Doc View Source

OnMetaChanged

Declaration
public event Sound.OnMetaChangedHandler OnMetaChanged
Event Type
Type Description
Sound.OnMetaChangedHandler
| Improve this Doc View Source

OnStart

Declaration
public event Sound.OnStartHandler OnStart
Event Type
Type Description
Sound.OnStartHandler
| Improve this Doc View Source

OnStop

Declaration
public event Sound.OnStopHandler OnStop
Event Type
Type Description
Sound.OnStopHandler
| Improve this Doc View Source

OnStream

Declaration
public event Sound.OnStreamHandler OnStream
Event Type
Type Description
Sound.OnStreamHandler
  • Improve this Doc
  • View Source
Back to top Generated by DocFX