sf::SoundStream Class Reference

SoundStream is a streamed sound, ie samples are acquired while the sound is playing. More...

#include <SoundStream.hpp>

Inheritance diagram for sf::SoundStream:

sf::Thread sf::Sound sf::Music List of all members.

Public Member Functions

virtual ~SoundStream ()
 Virtual destructor.
void Play ()
 Start playing the audio stream.
void Stop ()
 Stop playing the audio stream.
unsigned int GetChannelsCount () const
 Return the number of channels (1 = mono, 2 = stereo).
unsigned int GetSampleRate () const
 Get the stream sample rate.
Status GetStatus () const
 Get the status of the stream (stopped, paused, playing).
float GetPlayingOffset () const
 Get the current playing position of the stream.
void SetLoop (bool Loop)
 Set the stream loop state.
bool GetLoop () const
 Tell whether or not the stream is looping.

Protected Member Functions

 SoundStream ()
 Default constructor.
void Initialize (unsigned int ChannelsCount, unsigned int SampleRate)
 Set the audio stream parameters, you must call it before Play().

Classes

struct  Chunk
 Structure defining a chunk of audio data to stream. More...

Detailed Description

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

Definition at line 44 of file SoundStream.hpp.


Constructor & Destructor Documentation

virtual sf::SoundStream::~SoundStream (  )  [virtual]

Virtual destructor.

sf::SoundStream::SoundStream (  )  [protected]

Default constructor.


Member Function Documentation

void sf::SoundStream::Play (  ) 

Start playing the audio stream.

Reimplemented from sf::Sound.

void sf::SoundStream::Stop (  ) 

Stop playing the audio stream.

Reimplemented from sf::Sound.

unsigned int sf::SoundStream::GetChannelsCount (  )  const

Return the number of channels (1 = mono, 2 = stereo).

Returns:
Number of channels

unsigned int sf::SoundStream::GetSampleRate (  )  const

Get the stream sample rate.

Returns:
Stream frequency (number of samples per second)

Status sf::SoundStream::GetStatus (  )  const

Get the status of the stream (stopped, paused, playing).

Returns:
Current status of the sound

Reimplemented from sf::Sound.

float sf::SoundStream::GetPlayingOffset (  )  const

Get the current playing position of the stream.

Returns:
Current playing position, expressed in seconds

Reimplemented from sf::Sound.

void sf::SoundStream::SetLoop ( bool  Loop  ) 

Set the stream loop state.

This parameter is disabled by default

Parameters:
Loop : True to play in loop, false to play once

Reimplemented from sf::Sound.

bool sf::SoundStream::GetLoop (  )  const

Tell whether or not the stream is looping.

Returns:
True if the music is looping, false otherwise

Reimplemented from sf::Sound.

void sf::SoundStream::Initialize ( unsigned int  ChannelsCount,
unsigned int  SampleRate 
) [protected]

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

Parameters:
ChannelsCount : Number of channels
SampleRate : Sample rate


The documentation for this class was generated from the following file: