Add Audio Variables
- Dominant language
- C++
- Stars
- 1
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
### **Description**
Currently, the audio processing pipeline computes FFT data but does not extract distinct frequency bands (Bass, Mid, Treble) or their attenuated versions. This issue proposes adding support for:
- **Bass, Mid, Treble Extraction**: Compute frequency band loudness values from FFT.
- **Attenuation Variables**: Compute smoothed versions (`bassAtt`, `midAtt`, `trebleAtt`) using an exponential moving average (EMA).
### **Files**
Relevant files where modifications will be required:
- [`[Audio.cpp](https://github.com/divyansh1010x/MPV/blob/main/src/Audio.cpp)`](https://github.com/divyansh1010x/MPV/blob/main/src/Audio.cpp)
- [`[Audio.h](https://github.com/divyansh1010x/MPV/blob/main/src/Audio.h)`](https://github.com/divyansh1010x/MPV/blob/main/src/Audio.h)
- [`[FFTProcessor.cpp](https://github.com/divyansh1010x/MPV/blob/main/audio/FFTProcessor.cpp)`](https://github.com/divyansh1010x/MPV/blob/main/audio/FFTProcessor.cpp)
- [`[FFTProcessor.h](https://github.com/divyansh1010x/MPV/blob/main/audio/FFTProcessor.h)`](https://github.com/divyansh1010x/MPV/blob/main/audio/FFTProcessor.h)
### **To Reproduce**
Not applicable as this is a feature request.
### **Expected Behavior**
-Compute separate loudness values for Bass, Mid, and Treble using FFT magnitudes.
-Implement smoothed loudness values.
### **Actual Behavior**
Currently, the FFT processing returns raw magnitude data without frequency band separation or attenuation.
### **Tasks**
- Compute separate loudness values for **Bass, Mid, and Treble** using FFT magnitudes.
- Implement smoothed loudness values using an **exponential moving average (EMA)**.
### **Possible Fixes**
-Define frequency ranges to extract relevant data.
-Aggregate energy from selected bins.
-Implement a smoothing function to stabilize output values.
### **Additional Information**
- Reference from **projectM** implementation (`bass`, `bassAtt`, `mid`, `midAtt`, `treble`, `trebleAtt`).
- Verify performance impact of additional computations.
- Ensure **real-time performance** is not significantly affected.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.