SpeechSynthesizer Al Qaeda Style

Published 31 May 7 3:17 AM | William

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:
Adam Gadahn

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.

Search

This Blog

Tags

Community

Archives

News

  • William G Ryan William Ryan Bill Ryan W.G. Ryan Charles Mark Carroll Charles M Carroll
    My Blog Juice Microsoft MVP
    Bill Ryan W.G. Ryan William Ryan
    Cuckooz' MySpace Page View Bill Ryan's profile on LinkedIn
    My Profile on Twitter
    Please note that this is my personal blog and the opinions expressed are my own. Also, comment moderation is about one of the least important things in my life so please keep that in mind. I can't vouch for the authenticity of any of the posters so please don't hold me accountable. And whatever you do, don't pretend to be Noted Option Strict Off expert and AspFriend Charles Mark Carroll when you post. Doing so will lead him to become apoplectic and write absurd accusatory posts about me that are as coherent and thought out as they are factually correct. He does a stellar job proving his reputation is well deserved and he doesn't need any help from you making himself look foolish. If I have to listen to him banging his spoon off of his high chair one more time, I'm going to burst into flames so please don't make that happen!

    My other sites

    Cool Stuff

    Book Stuff

    Security

    ORM

    Data Access

    Funny Stuff

    Compact Framework Stuff

    Web Casts

    My KnowledgeBase Articles

    My MVP Profile

    Design Patterns

    Performance

    Debugging

    Remoting

    My Fellow Authors

    My Books

    LINQ

    Misc

    Speech

    Syndication

    Email Notifications