mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 06:49:24 -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);
|
feed_audio_stats(audio);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasebandProcessor::mute_audio() {
|
void BasebandProcessor::mute_audio(const buffer_s16_t& audio) {
|
||||||
i2s::i2s0::tx_mute();
|
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) {
|
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 feed_channel_stats(const buffer_c16_t& channel);
|
||||||
|
|
||||||
void fill_audio_buffer(const buffer_s16_t& audio);
|
void fill_audio_buffer(const buffer_s16_t& audio);
|
||||||
void mute_audio();
|
void mute_audio(const buffer_s16_t& audio);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ChannelStatsCollector channel_stats;
|
ChannelStatsCollector channel_stats;
|
||||||
|
@ -52,7 +52,7 @@ void NarrowbandFMAudio::execute(const buffer_c8_t& buffer) {
|
|||||||
if( audio_present ) {
|
if( audio_present ) {
|
||||||
fill_audio_buffer(audio);
|
fill_audio_buffer(audio);
|
||||||
} else {
|
} else {
|
||||||
mute_audio();
|
mute_audio(audio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user