25#ifndef SFML_SOUNDRECORDER_HPP
26#define SFML_SOUNDRECORDER_HPP
77 bool start(
unsigned int sampleRate = 44100);
247 void processCapturedSamples();
261 std::vector<Int16> m_samples;
262 unsigned int m_sampleRate;
263 Time m_processingInterval;
265 std::string m_deviceName;
AlResource()
Default constructor.
const std::string & getDevice() const
Get the name of the current audio capture device.
virtual bool onProcessSamples(const Int16 *samples, std::size_t sampleCount)=0
Process a new chunk of recorded samples.
static std::vector< std::string > getAvailableDevices()
Get a list of the names of all available audio capture devices.
SoundRecorder()
Default constructor.
bool start(unsigned int sampleRate=44100)
Start the capture.
virtual bool onStart()
Start capturing audio data.
void setProcessingInterval(Time interval)
Set the processing interval.
void stop()
Stop the capture.
bool setDevice(const std::string &name)
Set the audio capture device.
static bool isAvailable()
Check if the system supports audio capture.
virtual ~SoundRecorder()
destructor
static std::string getDefaultDevice()
Get the name of the default audio capture device.
unsigned int getSampleRate() const
Get the sample rate.
virtual void onStop()
Stop capturing audio data.
Utility class to manipulate threads.