-
Notifications
You must be signed in to change notification settings - Fork 1
Adding Volume Control and Filters
Phil Schatzmann edited this page Feb 23, 2022
·
7 revisions
In the following example we use I2S as final output
I2SStream i2s;
If we want to support volume control we can wrap it in a VolumeStream
VolumeStream volume(i2s); // volume support
We can wrap this further if we want to apply some additional Filters
SilenceRemovalConverter<int16_t> silence(8,2); // suppress silence
ConvertedStream<int16_t, SilenceRemovalConverter<int16_t>> out(volume,silence);
This will remove all samples with silence from the output. The remainder is as known. We just need to use the last wrapped Stream as output:
MP3DecoderHelix mp3;
AudioDictionary dictionary(ExampleAudioDictionaryValues);
NumberUnitToText utt;
TextToSpeech tts(utt, out, mp3, dictionary);
This implements the following output chain
mp3 (output) -> ConvertedStream with SilenceRemovalConverter -> VolumeStream -> I2S