mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-02 11:36:38 -04:00
Change baseband audio processing pipeline to all floats.
This commit is contained in:
parent
b9f124850b
commit
55e3a70fde
12 changed files with 90 additions and 56 deletions
|
@ -31,7 +31,7 @@
|
|||
class AudioStatsCollector {
|
||||
public:
|
||||
template<typename Callback>
|
||||
void feed(const buffer_s16_t& src, Callback callback) {
|
||||
void feed(const buffer_f32_t& src, Callback callback) {
|
||||
if( feed(src) ) {
|
||||
callback(statistics);
|
||||
}
|
||||
|
@ -46,17 +46,17 @@ public:
|
|||
|
||||
private:
|
||||
static constexpr float update_interval { 0.1f };
|
||||
uint64_t squared_sum { 0 };
|
||||
uint32_t max_squared { 0 };
|
||||
float squared_sum { 0 };
|
||||
float max_squared { 0 };
|
||||
size_t count { 0 };
|
||||
|
||||
AudioStatistics statistics;
|
||||
|
||||
void consume_audio_buffer(const buffer_s16_t& src);
|
||||
void consume_audio_buffer(const buffer_f32_t& src);
|
||||
|
||||
bool update_stats(const size_t sample_count, const size_t sampling_rate);
|
||||
|
||||
bool feed(const buffer_s16_t& src);
|
||||
bool feed(const buffer_f32_t& src);
|
||||
bool mute(const size_t sample_count, const size_t sampling_rate);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue