mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-23 22:39:22 -05:00
Fix broken audio stats when audio is muted.
This commit is contained in:
parent
4ea84301c6
commit
eb5b2d7d30
@ -54,8 +54,14 @@ void BasebandProcessor::fill_audio_buffer(const buffer_s16_t& audio) {
|
||||
feed_audio_stats(audio);
|
||||
}
|
||||
|
||||
void BasebandProcessor::mute_audio() {
|
||||
void BasebandProcessor::mute_audio(const buffer_s16_t& audio) {
|
||||
i2s::i2s0::tx_mute();
|
||||
|
||||
for(size_t i=0; i<audio.count; i++) {
|
||||
audio.p[i] = 0;
|
||||
}
|
||||
|
||||
feed_audio_stats(audio);
|
||||
}
|
||||
|
||||
void BasebandProcessor::feed_audio_stats(const buffer_s16_t& audio) {
|
||||
|
@ -44,7 +44,7 @@ protected:
|
||||
void feed_channel_stats(const buffer_c16_t& channel);
|
||||
|
||||
void fill_audio_buffer(const buffer_s16_t& audio);
|
||||
void mute_audio();
|
||||
void mute_audio(const buffer_s16_t& audio);
|
||||
|
||||
private:
|
||||
ChannelStatsCollector channel_stats;
|
||||
|
@ -52,7 +52,7 @@ void NarrowbandFMAudio::execute(const buffer_c8_t& buffer) {
|
||||
if( audio_present ) {
|
||||
fill_audio_buffer(audio);
|
||||
} else {
|
||||
mute_audio();
|
||||
mute_audio(audio);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user