private void PreSynthesizeText(SpeechElement element) { if (element.Kind.Equals(SpeechElementKind.Text) || element.Kind.Equals(SpeechElementKind.Ssml)) { synth.SynthesizeSsmlToStreamAsync(element.Content).AsTask <SpeechSynthesisStream>().ContinueWith((result) => { presynthesizedText.TryAdd(element.Content.GetHashCode(), result.Result); }); } }
void BeginSpeech() { canBeCrushed = true; SpeechElement speech = speechList.ChooseSpeech(); if (speech != null) { beginSpeechSeq = DOTween.Sequence(); beginSpeechSeq.Append(speechBubble.GetComponent <RectTransform>().DOScale(speechBubbleBaseScale, 0.2f)); beginSpeechSeq.Append(speechBubble.speechText.DOText(speech.text, gm.timePerCharacterMolenchonSpeech * speech.text.Length).SetEase(Ease.Linear)); beginSpeechSeq.OnComplete(() => EndOfSpeech()).Play(); } }
public MBROLAElement TranslateElement(SpeechElement e, Word w) { if (e is Phoneme) { return(new MBROLAElement(TranslatePhoneme((Phoneme)e, w), 100, 100)); } else if ((e is Separator) && HebrewChar.IsPunctuation(e.Latin[0])) { return(new MBROLAElement("_", 120)); } else { return(new MBROLAElement("_", 100)); } }
// Use this for initialization // void Start () { // } // Update is called once per frame // void Update () { // // } public void InitUserBubble(HammerUser user) { GetComponent <RectTransform>().localScale = Vector3.zero; SpeechElement speech = user.speechList.ChooseSpeech(); if (speech != null) { speechBubble.speechText.text = speech.text; // speechBubble.profilePicture.sprite = user.profilePicture; audioGroupNameToPlay = speech.audioGroupName; animationSeq.Restart(); if (speech.wallTexture != null && gm != null) { gm.ChangeTexture(speech.wallTexture); } } }