WARNING : this is the documentation for an old version of SFML. The documentation for the latest official release is available through the main menu.
WARNING : this is the documentation for an old version of SFML. The documentation for the latest official release is available through the main menu.
SoundStream is a streamed sound, ie samples are acquired while the sound is playing. More...
#include <SoundStream.hpp>
Inheritance diagram for sf::SoundStream:Classes | |
| struct | Chunk |
| Structure defining a chunk of audio data to stream. More... | |
Public Types | |
| enum | Status |
| Enumeration of the sound states. More... | |
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) | |
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() | |
Private Types | |
| typedef void(* | FuncType )(void *) |
Private Member Functions | |
| void | Launch () |
| Create and run the thread. | |
| void | Wait () |
| Wait until the thread finishes. | |
| void | Terminate () |
| Terminate the thread Terminating a thread with this function is not safe, you should rather try to make the thread function terminate by itself. | |
| void | Pause () |
| Pause the sound. | |
| void | SetBuffer (const SoundBuffer &Buffer) |
| Set the source buffer. | |
| void | SetLoop (bool Loop) |
| Set the sound loop state. | |
| void | SetPitch (float Pitch) |
| Set the sound pitch. | |
| void | SetVolume (float Volume) |
| Set the sound volume. | |
| void | SetPosition (float X, float Y, float Z) |
| Set the sound position (take 3 values). | |
| void | SetPosition (const Vector3f &Position) |
| Set the sound position (take a 3D vector). | |
| void | SetMinDistance (float MinDistance) |
| Set the minimum distance - closer than this distance, the listener will hear the sound at its maximum volume. | |
| void | SetAttenuation (float Attenuation) |
| Set the attenuation factor - the higher the attenuation, the more the sound will be attenuated with distance from listener. | |
| const SoundBuffer * | GetBuffer () const |
| Get the source buffer. | |
| bool | GetLoop () const |
| Tell whether or not the sound is looping. | |
| float | GetPitch () const |
| Get the pitch. | |
| float | GetVolume () const |
| Get the volume. | |
| Vector3f | GetPosition () const |
| Get the sound position. | |
| float | GetMinDistance () const |
| Get the minimum distance. | |
| float | GetAttenuation () const |
| Get the attenuation factor. | |
| float | GetPlayingOffset () const |
| Get the current playing position of the sound. | |
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 sfMusic), or for streaming sound from the network
Definition at line 44 of file SoundStream.hpp.
| enum sf::Sound::Status |
| virtual sf::SoundStream::~SoundStream | ( | ) | [virtual] |
Virtual destructor.
| sf::SoundStream::SoundStream | ( | ) | [protected] |
Default constructor.
| unsigned int sf::SoundStream::GetChannelsCount | ( | ) | const |
Return the number of channels (1 = mono, 2 = stereo)
| unsigned int sf::SoundStream::GetSampleRate | ( | ) | const |
Get the stream sample rate.
| Status sf::SoundStream::GetStatus | ( | ) | const |
Get the status of the stream (stopped, paused, playing)
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()
| ChannelsCount | : Number of channels |
| SampleRate | : Sample rate |
| 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.