C# Class SFML.Audio.Sound

Regular sound that can be played in the audio environment
Inheritance: SFML.System.ObjectBase
Mostra file Open project: SFML/SFML.Net Class Usage Examples

Public Methods

Method Description
Pause ( ) : void

Pause the sound. This function pauses the sound if it was playing, otherwise (sound already paused or stopped) it has no effect.

Play ( ) : void

Start or resume playing the sound. This function starts the stream if it was stopped, resumes it if it was paused, and restarts it from beginning if it was it already playing. This function uses its own thread so that it doesn't block the rest of the program while the sound is played.

Sound ( ) : System

Default constructor (invalid sound)

Sound ( Sound copy ) : System

Construct the sound from another source

Sound ( SoundBuffer buffer ) : System

Construct the sound with a buffer

Stop ( ) : void

Stop playing the sound. This function stops the sound if it was playing or paused, and does nothing if it was already stopped. It also resets the playing position (unlike pause()).

ToString ( ) : string

Provide a string describing the object

Protected Methods

Method Description
Destroy ( bool disposing ) : void

Handle the destruction of the object

Private Methods

Method Description
sfSound_copy ( IntPtr Sound ) : IntPtr
sfSound_create ( ) : IntPtr
sfSound_destroy ( IntPtr Sound ) : void
sfSound_getAttenuation ( IntPtr Sound ) : float
sfSound_getBuffer ( IntPtr Sound ) : IntPtr
sfSound_getLoop ( IntPtr Sound ) : bool
sfSound_getMinDistance ( IntPtr Sound ) : float
sfSound_getPitch ( IntPtr Sound ) : float
sfSound_getPlayingOffset ( IntPtr Sound ) : Time
sfSound_getPosition ( IntPtr Sound ) : Vector3f
sfSound_getStatus ( IntPtr Sound ) : SoundStatus
sfSound_getVolume ( IntPtr Sound ) : float
sfSound_isRelativeToListener ( IntPtr Sound ) : bool
sfSound_pause ( IntPtr Sound ) : void
sfSound_play ( IntPtr Sound ) : void
sfSound_setAttenuation ( IntPtr Sound, float Attenuation ) : void
sfSound_setBuffer ( IntPtr Sound, IntPtr Buffer ) : void
sfSound_setLoop ( IntPtr Sound, bool Loop ) : void
sfSound_setMinDistance ( IntPtr Sound, float MinDistance ) : void
sfSound_setPitch ( IntPtr Sound, float Pitch ) : void
sfSound_setPlayingOffset ( IntPtr Sound, Time TimeOffset ) : void
sfSound_setPosition ( IntPtr Sound, Vector3f position ) : void
sfSound_setRelativeToListener ( IntPtr Sound, bool Relative ) : void
sfSound_setVolume ( IntPtr Sound, float Volume ) : void
sfSound_stop ( IntPtr Sound ) : void

Method Details

Destroy() protected method

Handle the destruction of the object
protected Destroy ( bool disposing ) : void
disposing bool Is the GC disposing the object, or is it an explicit call ?
return void

Pause() public method

Pause the sound. This function pauses the sound if it was playing, otherwise (sound already paused or stopped) it has no effect.
public Pause ( ) : void
return void

Play() public method

Start or resume playing the sound. This function starts the stream if it was stopped, resumes it if it was paused, and restarts it from beginning if it was it already playing. This function uses its own thread so that it doesn't block the rest of the program while the sound is played.
public Play ( ) : void
return void

Sound() public method

Default constructor (invalid sound)
public Sound ( ) : System
return System

Sound() public method

Construct the sound from another source
public Sound ( Sound copy ) : System
copy Sound Sound to copy
return System

Sound() public method

Construct the sound with a buffer
public Sound ( SoundBuffer buffer ) : System
buffer SoundBuffer Sound buffer containing the audio data to play with the sound
return System

Stop() public method

Stop playing the sound. This function stops the sound if it was playing or paused, and does nothing if it was already stopped. It also resets the playing position (unlike pause()).
public Stop ( ) : void
return void

ToString() public method

Provide a string describing the object
public ToString ( ) : string
return string