/// <summary> /// This method handles text-to-speech audio source references by sending a <b>speak</b> command /// to the NeonSwitch core application to generate the audio file or obtained its cached /// location, and then return the path to the file. /// </summary> /// <param name="source">The audio source reference.</param> /// <returns> /// The path to the audio file for speech audio references and the unchanged source reference /// for all other audio source. /// </returns> private string HandleSpeech(string source) { // $hack(jeff.lill): // // This is a bit of a hack since it has hardcoded knowledge of the format of the // speech audio source reference. if (!source.StartsWith("say:")) { return(source); // Not speech } // The text after "say:" is the encoded phrase. We're going to execute a NeonSwitch speak // command that will render the phrase into an audio file (or perhaps an already cached // file) and then return the file path we get back from the NeonSwitch core. return(Switch.ExecuteCore("speak", source.Substring("say:".Length))); }