SpeechSynthesizer Al Qaeda Style
I don't know why, but every time I hear Adam Gadahn I start cracking up. I think he'd be a lot scarier with like a black cape, or a monacle and a persian or something but he doesn't get on me about how I dress, so I should grant him the same courtesy.. I know I know. This is serious stuff and I shouldn't be cracking jokes about it, but oh well. Anyway, I have dug into SSML enough that I'm starting to get pretty comfortable with it. After going through the PromptBuilder class, I realized it would in fact do everything I was looking for. So I decided to play around with it some. First, I pulled down a transcript of his latest video. Then I did a quick parse of it loading each sentence into a String array . I decided to see what it would sound like with him as a Teenage Girl and my good buddy the PromptBuilder was johny on the spot:
So first I changed my picture from the WereCuckoo to brother Adam:
Next I had to add a little code:
void btnSpeak_Click(object sender, RoutedEventArgs e)
{
SpeechSynthesizer sz = new SpeechSynthesizer();
PromptBuilder pb = new PromptBuilder();
String[] GadahnsRap = BuildGadahnText();
pb.StartParagraph();
pb.StartVoice(VoiceGender.Female, VoiceAge.Teen, 2);foreach (String Sentence in GadahnsRap)
{
pb.StartSentence();
pb.AppendText(Sentence);
pb.EndSentence();
}
pb.EndVoice();
pb.EndParagraph();
sz.SpeakSsml(pb.ToXml());
}
private String[] BuildGadahnText()
{
String textValues = null; using (StreamReader sr = new StreamReader(@"C:\Gadahn.txt"))
{
textValues = sr.ReadToEnd();
}
return textValues.Split('.');
}
All that was left now was to let it run. If you thought he was scarry before, you should here him as a teenage chick. Anyway, you can easily change the Voice inside the loop within each sentence, and use Random or whatever method you feel comfortable with to randomly change the voice. Doing this yeilds even funnier results. Creating a SSML writer was fun, and I learned a lot, but i think the PromptBuilder does everything I was hoping to accomplish and it's very easy to use, so i think I'm scrapping that project for now. If I can think of anything cool to do with this, I'll post it.