Hello,
i found a way to add sound effects on Text To Speech programmatically in C#.
Just want to share this, because it would be great if it could be implemented in VA (or provide stream externally for custom sound effects)
I'm using NAudio library for WaveFileReader
and a custom EffectStream where i put the magic of filtering an audio stream (like Chorus, Delay, Flanger, ...)
My main focus here was just to show it is possible to catch TTS audio and apply a custom thing before it is send to you're speaker :)
using NAudio.Wave; // for wave stream
using MyTestProject1.Audio.Effects; // for effects like EffectStream
SpeechSynthesizer ss = new SpeechSynthesizer();
...
var stream = new MemoryStream();
ss.SetOutputToWaveStream(stream);
ss.Speak(builder);
stream.Seek(0, SeekOrigin.Begin);
var reader = new WaveFileReader(stream);
var waveOut = new WaveOut();
EffectStream effectStream = new EffectStream(effects, reader);
waveOut.Init(effectStream);
waveOut.Play();
I hope i could see some day a check box for "TTS Say something" and "Apply Filter" and choose/customize effects to add echo or a robot-like effect ;)
Nanard