25 #ifndef SFML_SOUNDRECORDER_HPP
26 #define SFML_SOUNDRECORDER_HPP
31 #include <SFML/Audio/Export.hpp>
32 #include <SFML/Audio/AlResource.hpp>
33 #include <SFML/System/Thread.hpp>
34 #include <SFML/System/Time.hpp>
77 bool start(
unsigned int sampleRate = 44100);
275 void processCapturedSamples();
289 std::vector<Int16> m_samples;
290 unsigned int m_sampleRate;
291 Time m_processingInterval;
293 std::string m_deviceName;
294 unsigned int m_channelCount;
300 #endif // SFML_SOUNDRECORDER_HPP
unsigned int getSampleRate() const
Get the sample rate.
bool start(unsigned int sampleRate=44100)
Start the capture.
virtual void onStop()
Stop capturing audio data.
const std::string & getDevice() const
Get the name of the current audio capture device.
bool setDevice(const std::string &name)
Set the audio capture device.
void setProcessingInterval(Time interval)
Set the processing interval.
void setChannelCount(unsigned int channelCount)
Set the channel count of the audio capture device.
void stop()
Stop the capture.
static bool isAvailable()
Check if the system supports audio capture.
Base class for classes that require an OpenAL context.
unsigned int getChannelCount() const
Get the number of channels used by this recorder.
static std::string getDefaultDevice()
Get the name of the default audio capture device.
virtual ~SoundRecorder()
destructor
virtual bool onStart()
Start capturing audio data.
Utility class to manipulate threads.
SoundRecorder()
Default constructor.
static std::vector< std::string > getAvailableDevices()
Get a list of the names of all available audio capture devices.
virtual bool onProcessSamples(const Int16 *samples, std::size_t sampleCount)=0
Process a new chunk of recorded samples.
Abstract base class for capturing sound data.