25 #ifndef CPP3DS_SOUNDRECORDER_HPP
26 #define CPP3DS_SOUNDRECORDER_HPP
31 #include <cpp3ds/Audio/AlResource.hpp>
32 #include <cpp3ds/System/Thread.hpp>
33 #include <cpp3ds/System/Time.hpp>
37 #include <SFML/Audio/SoundRecorder.hpp>
81 bool start(
unsigned int sampleRate = 44100);
219 virtual bool onProcessSamples(
const Int16* samples, std::size_t sampleCount) = 0;
251 void processCapturedSamples();
265 std::vector<Int16> m_samples;
266 unsigned int m_sampleRate;
268 volatile bool m_isCapturing;
269 std::string m_deviceName;
276 volatile u32 audiobuf_size, audiobuf_pos;
283 #endif // CPP3DS_SOUNDRECORDER_HPP
virtual void onStop()
Stop capturing audio data.
Utility class to manipulate threads.
unsigned int getSampleRate() const
Get the sample rate.
bool setDevice(const std::string &name)
Set the audio capture device.
static std::vector< std::string > getAvailableDevices()
Get a list of the names of all availabe audio capture devices.
void stop()
Stop the capture.
void setProcessingInterval(cpp3ds::Time interval)
Set the processing interval.
const std::string & getDevice() const
Get the name of the current audio capture device.
bool start(unsigned int sampleRate=44100)
Start the capture.
virtual ~SoundRecorder()
destructor
virtual bool onStart()
Start capturing audio data.
Abstract base class for capturing sound data.
SoundRecorder()
Default constructor.
static std::string getDefaultDevice()
Get the name of the default audio capture device.
Base class for classes that require an OpenAL context.
virtual bool onProcessSamples(const Int16 *samples, std::size_t sampleCount)=0
Process a new chunk of recorded samples.
static bool isAvailable()
Check if the system supports audio capture.