C# Class SFML.Audio.Music

Music defines a big sound played using streaming, so usually what we call a music :)
Inheritance: SFML.System.ObjectBase
Mostrar archivo Open project: SFML/SFML.Net Class Usage Examples

Public Methods

Method Description
Music ( Stream stream ) : System

Constructs a music from a custom stream

Music ( byte bytes ) : System

Constructs a music from an audio file in memory

Music ( string filename ) : System

Constructs a music from an audio file

Pause ( ) : void

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

Play ( ) : void

Start or resume playing the audio stream. 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 stream is played.

Stop ( ) : void

Stop playing the audio stream. This function stops the stream 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
sfMusic_createFromFile ( string Filename ) : IntPtr
sfMusic_createFromMemory ( IntPtr data, ulong size ) : IntPtr
sfMusic_createFromStream ( IntPtr stream ) : IntPtr
sfMusic_destroy ( IntPtr MusicStream ) : void
sfMusic_getAttenuation ( IntPtr Music ) : float
sfMusic_getChannelCount ( IntPtr Music ) : uint
sfMusic_getDuration ( IntPtr Music ) : Time
sfMusic_getLoop ( IntPtr Music ) : bool
sfMusic_getMinDistance ( IntPtr Music ) : float
sfMusic_getPitch ( IntPtr Music ) : float
sfMusic_getPlayingOffset ( IntPtr Music ) : Time
sfMusic_getPosition ( IntPtr Music ) : Vector3f
sfMusic_getSampleRate ( IntPtr Music ) : uint
sfMusic_getStatus ( IntPtr Music ) : SoundStatus
sfMusic_getVolume ( IntPtr Music ) : float
sfMusic_isRelativeToListener ( IntPtr Music ) : bool
sfMusic_pause ( IntPtr Music ) : void
sfMusic_play ( IntPtr Music ) : void
sfMusic_setAttenuation ( IntPtr Music, float Attenuation ) : void
sfMusic_setLoop ( IntPtr Music, bool Loop ) : void
sfMusic_setMinDistance ( IntPtr Music, float MinDistance ) : void
sfMusic_setPitch ( IntPtr Music, float Pitch ) : void
sfMusic_setPlayingOffset ( IntPtr Music, Time TimeOffset ) : void
sfMusic_setPosition ( IntPtr Music, Vector3f position ) : void
sfMusic_setRelativeToListener ( IntPtr Music, bool Relative ) : void
sfMusic_setVolume ( IntPtr Music, float Volume ) : void
sfMusic_stop ( IntPtr Music ) : 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

Music() public method

Constructs a music from a custom stream
public Music ( Stream stream ) : System
stream Stream Source stream to read from
return System

Music() public method

Constructs a music from an audio file in memory
public Music ( byte bytes ) : System
bytes byte Byte array containing the file contents
return System

Music() public method

Constructs a music from an audio file
public Music ( string filename ) : System
filename string Path of the music file to open
return System

Pause() public method

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

Play() public method

Start or resume playing the audio stream. 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 stream is played.
public Play ( ) : void
return void

Stop() public method

Stop playing the audio stream. This function stops the stream 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