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);
97 unsigned int getSampleRate()
const;
108 static std::vector<std::string> getAvailableDevices();
120 static std::string getDefaultDevice();
137 bool setDevice(
const std::string& name);
145 const std::string& getDevice()
const;
158 static bool isAvailable();
186 void setProcessingInterval(
sf::Time interval);
199 virtual bool onStart();
215 virtual bool onProcessSamples(
const Int16* samples, std::size_t sampleCount) = 0;
226 virtual void onStop();
247 void processCapturedSamples();
261 std::vector<Int16> m_samples;
262 unsigned int m_sampleRate;
265 std::string m_deviceName;
271 #endif // SFML_SOUNDRECORDER_HPP
Base class for classes that require an OpenAL context.
Abstract base class for capturing sound data.
Utility class to manipulate threads.