Base Framework
|
Sound output stream. More...
#include <base/sound/SoundOutputStream.h>
Inherits Object.
Public Member Functions | |
SoundOutputStream (unsigned int samplingRate, unsigned int channels) | |
unsigned int | getChannels () const noexcept |
unsigned int | getRate () const noexcept |
unsigned int | getPosition () const noexcept |
void | resume () noexcept |
void | pause () noexcept |
void | reset () noexcept |
void | wait () noexcept |
unsigned int | write (const void *buffer, unsigned int size) |
~SoundOutputStream () noexcept | |
SoundOutputStream::SoundOutputStream | ( | unsigned int | samplingRate, |
unsigned int | channels | ||
) |
Initializes the sound output device. Common sampling rates are 5000Hz, 8000Hz, 11025Hz, 22050Hz, 44100Hz, and 48000Hz.
samplingRate | The sampling rate specified in samples per second. |
channels | The number of channels (must be greater than 0). |
|
noexcept |
Destructs the stream object.
|
noexcept |
Returns the number of channels (greater than 0).
|
noexcept |
Returns the total number of samples since the last resume.
|
noexcept |
Returns the sampling rate (samples per second).
|
noexcept |
Pauses the stream.
|
noexcept |
Resets the device.
|
noexcept |
Resumes the stream.
|
noexcept |
Wait for all the samples to be played back.
unsigned int SoundOutputStream::write | ( | const void * | buffer, |
unsigned int | size | ||
) |
Writes bytes in buffer to stream.
buffer | The buffer containing the bytes to be written. |
size | The number of bytes to be written. |