FastLED 3.10.8
Loading...
Searching...
No Matches
fl::audio::detector::MoodAnalyzer Class Reference

Detailed Description

Definition at line 64 of file mood_analyzer.h.

#include <mood_analyzer.h>

+ Inheritance diagram for fl::audio::detector::MoodAnalyzer:
+ Collaboration diagram for fl::audio::detector::MoodAnalyzer:

Public Member Functions

 MoodAnalyzer () FL_NO_EXCEPT
 
 ~MoodAnalyzer () FL_NO_EXCEPT override
 
void fireCallbacks () FL_NO_EXCEPT override
 
float getArousal () const FL_NO_EXCEPT
 
const Mood & getCurrentMood () const FL_NO_EXCEPT
 
Mood::Category getMoodCategory () const FL_NO_EXCEPT
 
const char * getName () const FL_NO_EXCEPT override
 
float getValence () const FL_NO_EXCEPT
 
bool needsFFT () const FL_NO_EXCEPT override
 
bool needsFFTHistory () const FL_NO_EXCEPT override
 
void reset () FL_NO_EXCEPT override
 
void setAveragingFrames (int frames) FL_NO_EXCEPT
 
void setConfidenceThreshold (float threshold) FL_NO_EXCEPT
 
void setMinDuration (u32 ms) FL_NO_EXCEPT
 
void update (shared_ptr< Context > context) FL_NO_EXCEPT override
 
- Public Member Functions inherited from fl::audio::Detector
virtual ~Detector () FL_NO_EXCEPT=default
 
virtual void setSampleRate (int) FL_NO_EXCEPT
 

Public Attributes

function_list< void(const Mood &mood)> onMood
 
function_list< void(const Mood &mood)> onMoodChange
 
function_list< void(float valence, float arousal)> onValenceArousal
 

Private Member Functions

float calculateArousal (float rms, float zcr, float flux) FL_NO_EXCEPT
 
float calculateConfidence (float valence, float arousal) FL_NO_EXCEPT
 
float calculateSpectralCentroid (const fft::Bins &fft) FL_NO_EXCEPT
 
float calculateSpectralFlux (const fft::Bins &fft, const fft::Bins *prevFFT) FL_NO_EXCEPT
 
float calculateSpectralRolloff (const fft::Bins &fft, float threshold=0.85f) FL_NO_EXCEPT
 
float calculateValence (float centroid, float rolloff, float flux) FL_NO_EXCEPT
 
bool shouldChangeMood (const Mood &newMood) FL_NO_EXCEPT
 

Private Attributes

fl::vector< float > mArousalHistory
 
int mAveragingFrames
 
float mConfidenceThreshold
 
Mood mCurrentMood
 
int mHistoryIndex
 
u32 mMinDuration
 
bool mMoodChanged = false
 
Mood mPreviousMood
 
shared_ptr< const fft::Bins > mRetainedFFT
 
float mRMSEnergy
 
float mSpectralCentroid
 
float mSpectralFlux
 
float mSpectralRolloff
 
fl::vector< float > mValenceHistory
 
float mZeroCrossingRate
 

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