gramods
|
Sound detector search for samples over a specified threshold. More...
#include <SoundBurstDetector.hh>
Classes | |
struct | Impl |
Public Member Functions | |
void | setThreshold (float r) |
Sets the threshold used for detecting a sound event in the range 0-1. More... | |
void | setCooldown (float t) |
Sets the cooldown time for a detection, i.e. More... | |
std::vector< std::vector< float > > | detectSound () override |
Reads off new samples from the capture device, if such are available, then detect sound based over the specified threshold, estimating how long ago the sound appeared in each channel. More... | |
![]() | |
size_t | getSampleRate () |
Returns the sample rate. More... | |
size_t | getChannelCount () |
Sets the number of channels to attempt to open for the capture device. More... | |
void | setCapture (std::shared_ptr< Capture > c) |
Sets the capture object to read audio sample data from. More... | |
void | setWindow (float t) |
Sets the time window (in seconds) over which to search for matching events. More... | |
std::string | getDefaultKey () override |
Returns the default key for the Object when automatically instantiated in a Configuration, i.e. More... | |
![]() | |
Object () | |
Initializes internal data. More... | |
virtual | ~Object () |
Cleaning up internal data. More... | |
virtual void | initialize () |
Called to initialize the Object. More... | |
virtual void | accept (Visitor *visitor) |
Calls the visitors apply method with this as argument. More... | |
virtual void | traverse (Visitor *visitor) |
Calls the child Object's accept method, if such exist. More... | |
bool | isInitialized () |
Returns true if the Object is initialized. More... | |
Public Attributes | |
GM_OFI_DECLARE | |
![]() | |
GM_OFI_DECLARE | |
Additional Inherited Members | |
![]() | |
const std::vector< std::deque< float > > & | getData () |
Fetches the current data that span the specified window. More... | |
Sound detector search for samples over a specified threshold.
|
overridevirtual |
Reads off new samples from the capture device, if such are available, then detect sound based over the specified threshold, estimating how long ago the sound appeared in each channel.
Implements gramods::gmSound::SoundDetector.
void gramods::gmSound::SoundBurstDetector::setCooldown | ( | float | t | ) |
Sets the cooldown time for a detection, i.e.
the time between two samples over the threshold that is considered another sound. Default is 0.1 seconds.
XML-attribute: cooldown
void gramods::gmSound::SoundBurstDetector::setThreshold | ( | float | r | ) |
Sets the threshold used for detecting a sound event in the range 0-1.
Default is 70%.
XML-attribute: threshold