C# Class SFML.Audio.SoundStream

SoundStream is a streamed sound, ie. samples are acquired while the sound is playing. Use it for big sounds that would require hundreds of MB in memory (see Music), or for streaming sound from the network
Inheritance: SFML.System.ObjectBase
Afficher le fichier Open project: SFML/SFML.Net

Méthodes publiques

Méthode Description
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.

SoundStream ( ) : System

Default constructor

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

Méthodes protégées

Méthode Description
Destroy ( bool disposing ) : void

Handle the destruction of the object

Initialize ( uint channelCount, uint sampleRate ) : void

Set the audio stream parameters, you must call it before Play()

OnGetData ( short &samples ) : bool

Virtual function called each time new audio data is needed to feed the stream

OnSeek ( Time timeOffset ) : void

Virtual function called to seek into the stream

Private Methods

Méthode Description
GetData ( Chunk &dataChunk, IntPtr userData ) : bool

Called each time new audio data is needed to feed the stream

Seek ( Time timeOffset, IntPtr userData ) : void

Called to seek in the stream

sfSoundStream_create ( GetDataCallbackType OnGetData, SeekCallbackType OnSeek, uint ChannelCount, uint SampleRate, IntPtr UserData ) : IntPtr
sfSoundStream_destroy ( IntPtr SoundStreamStream ) : void
sfSoundStream_getAttenuation ( IntPtr SoundStream ) : float
sfSoundStream_getChannelCount ( IntPtr SoundStream ) : uint
sfSoundStream_getLoop ( IntPtr SoundStream ) : bool
sfSoundStream_getMinDistance ( IntPtr SoundStream ) : float
sfSoundStream_getPitch ( IntPtr SoundStream ) : float
sfSoundStream_getPlayingOffset ( IntPtr SoundStream ) : Time
sfSoundStream_getPosition ( IntPtr SoundStream ) : Vector3f
sfSoundStream_getSampleRate ( IntPtr SoundStream ) : uint
sfSoundStream_getStatus ( IntPtr SoundStream ) : SoundStatus
sfSoundStream_getVolume ( IntPtr SoundStream ) : float
sfSoundStream_isRelativeToListener ( IntPtr SoundStream ) : bool
sfSoundStream_pause ( IntPtr SoundStream ) : void
sfSoundStream_play ( IntPtr SoundStream ) : void
sfSoundStream_setAttenuation ( IntPtr SoundStream, float Attenuation ) : void
sfSoundStream_setLoop ( IntPtr SoundStream, bool Loop ) : void
sfSoundStream_setMinDistance ( IntPtr SoundStream, float MinDistance ) : void
sfSoundStream_setPitch ( IntPtr SoundStream, float Pitch ) : void
sfSoundStream_setPlayingOffset ( IntPtr SoundStream, Time TimeOffset ) : void
sfSoundStream_setPosition ( IntPtr SoundStream, Vector3f position ) : void
sfSoundStream_setRelativeToListener ( IntPtr SoundStream, bool Relative ) : void
sfSoundStream_setVolume ( IntPtr SoundStream, float Volume ) : void
sfSoundStream_stop ( IntPtr SoundStream ) : void

Method Details

Destroy() protected méthode

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 ?
Résultat void

Initialize() protected méthode

Set the audio stream parameters, you must call it before Play()
protected Initialize ( uint channelCount, uint sampleRate ) : void
channelCount uint Number of channels
sampleRate uint Sample rate, in samples per second
Résultat void

OnGetData() protected abstract méthode

Virtual function called each time new audio data is needed to feed the stream
protected abstract OnGetData ( short &samples ) : bool
samples short Array of samples to fill for the stream
Résultat bool

OnSeek() protected abstract méthode

Virtual function called to seek into the stream
protected abstract OnSeek ( Time timeOffset ) : void
timeOffset Time New position
Résultat void

Pause() public méthode

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
Résultat void

Play() public méthode

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
Résultat void

SoundStream() public méthode

Default constructor
public SoundStream ( ) : System
Résultat System

Stop() public méthode

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
Résultat void

ToString() public méthode

Provide a string describing the object
public ToString ( ) : string
Résultat string