25#ifndef SFML_SOUNDRECORDER_HPP
26#define SFML_SOUNDRECORDER_HPP
76 bool start(
unsigned int sampleRate = 44100);
246 void processCapturedSamples();
260 std::vector<Int16> m_samples;
261 unsigned int m_sampleRate;
264 std::string m_deviceName;
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.
void setProcessingInterval(sf::Time interval)
Set the processing interval.
bool start(unsigned int sampleRate=44100)
Start the capture.
virtual bool onStart()
Start capturing audio data.
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.