El Octavio
1.0
This is a video game about adventures.
|
Specialized SoundRecorder which stores the captured audio data into a sound buffer. More...
#include <SoundBufferRecorder.hpp>
Public Member Functions | |
~SoundBufferRecorder () | |
destructor More... | |
const SoundBuffer & | getBuffer () const |
Get the sound buffer containing the captured audio data. More... | |
![]() | |
virtual | ~SoundRecorder () |
destructor More... | |
bool | start (unsigned int sampleRate=44100) |
Start the capture. More... | |
void | stop () |
Stop the capture. More... | |
unsigned int | getSampleRate () const |
Get the sample rate. More... | |
bool | setDevice (const std::string &name) |
Set the audio capture device. More... | |
const std::string & | getDevice () const |
Get the name of the current audio capture device. More... | |
void | setChannelCount (unsigned int channelCount) |
Set the channel count of the audio capture device. More... | |
unsigned int | getChannelCount () const |
Get the number of channels used by this recorder. More... | |
Protected Member Functions | |
virtual bool | onStart () |
Start capturing audio data. More... | |
virtual bool | onProcessSamples (const Int16 *samples, std::size_t sampleCount) |
Process a new chunk of recorded samples. More... | |
virtual void | onStop () |
Stop capturing audio data. More... | |
![]() | |
SoundRecorder () | |
Default constructor. More... | |
void | setProcessingInterval (Time interval) |
Set the processing interval. More... | |
virtual bool | onStart () |
Start capturing audio data. More... | |
virtual bool | onProcessSamples (const Int16 *samples, std::size_t sampleCount)=0 |
Process a new chunk of recorded samples. More... | |
virtual void | onStop () |
Stop capturing audio data. More... | |
Additional Inherited Members | |
![]() | |
static std::vector< std::string > | getAvailableDevices () |
Get a list of the names of all available audio capture devices. More... | |
static std::string | getDefaultDevice () |
Get the name of the default audio capture device. More... | |
static bool | isAvailable () |
Check if the system supports audio capture. More... | |
Specialized SoundRecorder which stores the captured audio data into a sound buffer.
sf::SoundBufferRecorder allows to access a recorded sound through a sf::SoundBuffer, so that it can be played, saved to a file, etc.
It has the same simple interface as its base class (start(), stop()) and adds a function to retrieve the recorded sound buffer (getBuffer()).
As usual, don't forget to call the isAvailable() function before using this class (see sf::SoundRecorder for more details about this).
Usage example:
Definition at line 44 of file SoundBufferRecorder.hpp.
sf::SoundBufferRecorder::~SoundBufferRecorder | ( | ) |
destructor
const SoundBuffer & sf::SoundBufferRecorder::getBuffer | ( | ) | const |
Get the sound buffer containing the captured audio data.
The sound buffer is valid only after the capture has ended. This function provides a read-only access to the internal sound buffer, but it can be copied if you need to make any modification to it.
|
protectedvirtual |
Process a new chunk of recorded samples.
samples | Pointer to the new chunk of recorded samples |
sampleCount | Number of samples pointed by samples |
Implements sf::SoundRecorder.
|
protectedvirtual |
Start capturing audio data.
Reimplemented from sf::SoundRecorder.
|
protectedvirtual |
Stop capturing audio data.
Reimplemented from sf::SoundRecorder.