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;
160 void setChannelCount(
unsigned int channelCount);
173 unsigned int getChannelCount()
const;
186 static bool isAvailable();
214 void setProcessingInterval(
Time interval);
227 virtual bool onStart();
243 virtual bool onProcessSamples(
const Int16* samples, std::size_t sampleCount) = 0;
254 virtual void onStop();
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
Base class for classes that require an OpenAL context.
Abstract base class for capturing sound data.
Utility class to manipulate threads.