gramods
Classes | Public Member Functions | Public Attributes | List of all members
gramods::gmSound::SoundBurstDetector Class Reference

Sound detector search for samples over a specified threshold. More...

#include <SoundBurstDetector.hh>

Inheritance diagram for gramods::gmSound::SoundBurstDetector:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmSound::SoundBurstDetector:
Collaboration graph
[legend]

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...
 
- Public Member Functions inherited from gramods::gmSound::SoundDetector
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...
 
- Public Member Functions inherited from gramods::gmCore::Object
 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
 
- Public Attributes inherited from gramods::gmSound::SoundDetector
 GM_OFI_DECLARE
 

Additional Inherited Members

- Protected Member Functions inherited from gramods::gmSound::SoundDetector
const std::vector< std::deque< float > > & getData ()
 Fetches the current data that span the specified window. More...
 

Detailed Description

Sound detector search for samples over a specified threshold.

Member Function Documentation

◆ detectSound()

std::vector< std::vector< float > > gramods::gmSound::SoundBurstDetector::detectSound ( )
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.

See also
SoundDetector::detectSound

Implements gramods::gmSound::SoundDetector.

◆ setCooldown()

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

◆ setThreshold()

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


The documentation for this class was generated from the following files: