Skip to content

Commit 8eb9fce

Browse files
finneyjmicrobit-carlos
authored andcommitted
Filter audio data that can arrive when hardware is disabled (#478)
1 parent a768622 commit 8eb9fce

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

source/MicroBitAudio.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ MicroBitAudio::MicroBitAudio(NRF52Pin &pin, NRF52Pin &speaker, NRF52ADC &adc, NR
7878

7979
//Initilise input splitter
8080
rawSplitter = new StreamSplitter(mic->output);
81+
rawSplitter->filterOn(&micEnabled);
8182

8283
//Initilise stream normalizer
8384
processor = new StreamNormalizer(*rawSplitter->createChannel(), 0.08f, true, DATASTREAM_FORMAT_8BIT_SIGNED, 10);

0 commit comments

Comments
 (0)