2 #ifndef GRAMODS_SOUND_SOUNDDETECTOR
3 #define GRAMODS_SOUND_SOUNDDETECTOR
5 #include <gmSound/config.hh>
7 #include <gmSound/Capture.hh>
75 const std::vector<std::deque<float>> &
getData();
79 std::unique_ptr<Impl> _impl;
Base type for objects in the Gramods package for standardized handling of construction,...
Definition: Object.hh:42
The interface for an algorithm detecting sound in an audio stream.
Definition: SoundDetector.hh:17
size_t getChannelCount()
Sets the number of channels to attempt to open for the capture device.
Definition: SoundDetector.cpp:35
std::string getDefaultKey() override
Returns the default key for the Object when automatically instantiated in a Configuration,...
Definition: SoundDetector.hh:65
void setCapture(std::shared_ptr< Capture > c)
Sets the capture object to read audio sample data from.
Definition: SoundDetector.cpp:40
const std::vector< std::deque< float > > & getData()
Fetches the current data that span the specified window.
Definition: SoundDetector.cpp:53
size_t getSampleRate()
Returns the sample rate.
Definition: SoundDetector.cpp:30
void setWindow(float t)
Sets the time window (in seconds) over which to search for matching events.
Definition: SoundDetector.cpp:47
virtual std::vector< std::vector< float > > detectSound()=0
Calls getData and applies the implementation specific algorithm to these data to detect sound in the ...
Gramods, short for Graphics Modules, is a collection of weakly inter dependent and useful APIs for Vi...
Definition: config.hh:25