25#ifndef SFML_SOUNDSTREAM_HPP
26#define SFML_SOUNDSTREAM_HPP
31#include <SFML/Audio/Sound.hpp>
32#include <SFML/System/Thread.hpp>
157 void Initialize(
unsigned int ChannelsCount,
unsigned int SampleRate);
173 virtual bool OnStart();
183 virtual bool OnGetData(
Chunk& Data) = 0;
194 bool FillAndPushBuffer(
unsigned int BufferNum);
210 enum {BuffersCount = 3};
216 unsigned int myBuffers[BuffersCount];
217 unsigned int myChannelsCount;
218 unsigned int mySampleRate;
219 unsigned long myFormat;
221 unsigned int mySamplesProcessed;
222 bool myEndBuffers[BuffersCount];
void SetLoop(bool Loop)
Set the stream loop state.
Status
Enumeration of the sound states.
void Play()
Start playing the audio stream.
void Stop()
Stop playing the audio stream.
float GetPlayingOffset() const
Get the current playing position of the stream.
Status GetStatus() const
Get the status of the stream (stopped, paused, playing).
SoundStream()
Default constructor.
unsigned int GetSampleRate() const
Get the stream sample rate.
bool GetLoop() const
Tell whether or not the stream is looping.
void Initialize(unsigned int ChannelsCount, unsigned int SampleRate)
Set the audio stream parameters, you must call it before Play().
unsigned int GetChannelsCount() const
Return the number of channels (1 = mono, 2 = stereo).
void SetMinDistance(float MinDistance)
Set the minimum distance - closer than this distance, the listener will hear the sound at its maximum...
void SetVolume(float Volume)
Set the sound volume.
Status
Enumeration of the sound states.
@ Playing
Sound is playing.
@ Stopped
Sound is not playing.
bool IsRelativeToListener() const
Tell if the sound's position is relative to the listener's position, or if it's absolute.
Sound()
Default constructor.
float GetVolume() const
Get the volume.
void Pause()
Pause the sound.
float GetAttenuation() const
Get the attenuation factor.
void SetRelativeToListener(bool Relative)
Make the sound's position relative to the listener's position, or absolute.
Vector3f GetPosition() const
Get the sound position.
void SetPosition(float X, float Y, float Z)
Set the sound position (take 3 values).
float GetPitch() const
Get the pitch.
void SetAttenuation(float Attenuation)
Set the attenuation factor - the higher the attenuation, the more the sound will be attenuated with d...
float GetMinDistance() const
Get the minimum distance.
void SetPitch(float Pitch)
Set the sound pitch.
Thread(FuncType Function, void *UserData=NULL)
Construct the thread from a function pointer.
Structure defining a chunk of audio data to stream.
std::size_t NbSamples
Number of samples pointed by Samples.
const Int16 * Samples
Pointer to the audio samples.