public Step( string text, Score score ) { parentScore = score; command = "narrate"; content = text; tone = SpeechTone.NORMAL; delay = 0; substeps = new List<Step>(); ParseCommand(); }
public Step(string text, Score score) { parentScore = score; command = "narrate"; content = text; tone = SpeechTone.NORMAL; delay = 0; substeps = new List <Step>(); ParseCommand(); }
public void ParseCommand() { switch (command) { case "speak": case "sing": if (data.Attributes.GetNamedItem("tone") != null) { tone = (SpeechTone)System.Enum.Parse(typeof(SpeechTone), data.Attributes.GetNamedItem("tone").InnerXml.ToUpper()); } else { tone = SpeechTone.NORMAL; } break; case "settemperature": if (data.Attributes.GetNamedItem("units") != null) { units = (TemperatureUnits)System.Enum.Parse(typeof(TemperatureUnits), data.Attributes.GetNamedItem("units").InnerXml.ToUpper()); } else { units = TemperatureUnits.CELSIUS; } break; case "setweather": weather = content != null ? (WeatherConditions)System.Enum.Parse(typeof(WeatherConditions), content.ToUpper()) : WeatherConditions.CLEAR; break; case "setdate": case "settime": date = DateTime.Parse(content); break; case "setsequence": if (data.Attributes.GetNamedItem("atDate") != null) { atDate = DateTime.Parse(data.Attributes.GetNamedItem("atDate").InnerXml); } if (data.Attributes.GetNamedItem("autoStart") != null) { autoStart = data.Attributes.GetNamedItem("autoStart").InnerXml == "true" ? true : false; } break; } }
public void SpeakWith(SpeechTone tone) { StopAllCoroutines(); string tempString; switch (tone) { case SpeechTone.Bored: switch (sigCon.CorrectChannelSignal()) { case ChannelType.Sport: theText.text = switchToSport; break; case ChannelType.News: theText.text = switchToNews; break; case ChannelType.Concert: theText.text = switchToConcert; break; default: theText.text = "When will this commercial end?"; break; } break; case SpeechTone.Annoyed: tempString = wrongChannel.Replace("<channeltype>", sigCon.CorrectChannelSignal().ToString()); theText.text = tempString; break; case SpeechTone.GaveUp: theText.text = stopWatching; break; default: theText.text = "???"; break; } StartCoroutine(SayIt((int)tone)); }
public void ParseCommand() { switch ( command ) { case "speak": if ( data.Attributes.GetNamedItem( "tone" ) != null ) { tone = (SpeechTone) System.Enum.Parse ( typeof(SpeechTone), data.Attributes.GetNamedItem( "tone" ).InnerXml.ToUpper() ); } break; case "settemperature": if ( data.Attributes.GetNamedItem( "units" ) != null ) { units = (TemperatureUnits) System.Enum.Parse ( typeof(TemperatureUnits), data.Attributes.GetNamedItem( "units" ).InnerXml.ToUpper() ); } else { units = TemperatureUnits.CELSIUS; } break; case "setweather": weather = content != null ? (WeatherConditions) System.Enum.Parse ( typeof(WeatherConditions), content.ToUpper() ) : WeatherConditions.CLEAR; break; case "setdate": case "settime": date = DateTime.Parse( content ); break; case "setsequence": if ( data.Attributes.GetNamedItem( "atDate" ) != null ) { atDate = DateTime.Parse( data.Attributes.GetNamedItem( "atDate" ).InnerXml ); } if ( data.Attributes.GetNamedItem( "autoStart" ) != null ) { autoStart = data.Attributes.GetNamedItem( "autoStart" ).InnerXml == "true" ? true : false; } break; } }
// Say something // We will use human-recoded voices for more realistic speech generation purpose // Such speeches are designer-specifed voice cues rather than synsthesization based methods, used specifically for specific responses /// <summary> /// Speak some sentence in a natural tone using recorded voices /// </summary> /// <param name="content"></param> /// <param name="tone"></param> public void ProduceSpeech(string content, SpeechTone tone) { throw new NotImplementedException(); }