25 #ifndef SFML_SOUNDRECORDER_HPP
26 #define SFML_SOUNDRECORDER_HPP
31 #include <SFML/Audio/Export.hpp>
32 #include <SFML/System/Thread.hpp>
33 #include <SFML/System/Time.hpp>
76 bool start(
unsigned int sampleRate = 44100);
96 unsigned int getSampleRate()
const;
107 static std::vector<std::string> getAvailableDevices();
119 static std::string getDefaultDevice();
136 bool setDevice(
const std::string& name);
144 const std::string& getDevice()
const;
157 static bool isAvailable();
185 void setProcessingInterval(
sf::Time interval);
198 virtual bool onStart();
214 virtual bool onProcessSamples(
const Int16* samples, std::size_t sampleCount) = 0;
225 virtual void onStop();
246 void processCapturedSamples();
260 std::vector<Int16> m_samples;
261 unsigned int m_sampleRate;
264 std::string m_deviceName;
270 #endif // SFML_SOUNDRECORDER_HPP
Abstract base class for capturing sound data.
Utility class to manipulate threads.