33 #ifndef _NSOUND_AUDIO_PLAYBACK_H_
34 #define _NSOUND_AUDIO_PLAYBACK_H_
55 const float64 & sample_rate = 44100.0,
57 const uint32 bits_per_sample = 16);
130 setOption(
const std::string & key,
const std::string & value);
182 void use(
const std::string & backend);
void setBitsPerSample(uint32 bits_per_sample)
std::string getError()
Returns an error string describing any backend error.
static AudioBackendType getBackendType()
Gets the AudioBackendType that is currently set.
void initialize()
Initializes the backend and transitions to the BACKEND_READY state on success.
void scanDevices()
Scans for devices and tries to play a test sound.
void setOption(const std::string &key, const std::string &value)
Sets an options, must be called before initialize().
AudioBackend::State getState()
Returns the backend state.
uint32 getBitsPerSample()
void use(const std::string &backend)
Selects the AudioBackend to use by name.
AudioPlayback(const float64 &sample_rate=44100.0, const uint32 channels=1, const uint32 bits_per_sample=16)
void shutdown()
Shuts down the backend.
static AudioBackendType backend_type_
void operator>>(const AudioStream &lhs, AudioPlayback &rhs)
static void setBackendType(const AudioBackendType ab)
Sets the AudioBackendType.
friend void operator>>(const AudioStream &lhs, AudioPlayback &rhs)
std::string getStateString()
Returns the backend state string.
AudioPlayback(const AudioPlayback ©)
std::vector< AudioBackendType > getBackendTypes()
Returns a list of the available audio backends types.
AudioPlayback & operator=(const AudioPlayback &rhs)
std::string getInfo()
Returns information about the backend driver.
void setChannels(uint32 channels)
A Buffer for storing audio samples.
void play(const AudioStream &a)
Plays the AudioStream throuh the backend.
void setSampleRate(uint32 sample_rate)
std::vector< std::string > getBackends()
Returns a list of the available audio backends by name.