Search Unity

RT-Voice - Run-time text-to-speech solution

Discussion in 'Assets and Asset Store' started by Stefan-Laubenberger, Jul 10, 2015.

  1. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    142
    2017.1.2
    windows 7
     
  2. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    64bit or 32bit?

    Anyway, please add the "RTVoice"-prefab to the scene instead of the script.
    It should work, this seems a bit weird...
     
  3. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    142
     

    Attached Files:

  4. Devision4

    Devision4

    Joined:
    Jan 12, 2013
    Posts:
    1,292
    How does the intregration with Adventure Creator work??! Is there a tutorial?
     
  5. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hi

    There is an integration in the "3rd party"-folder. Just import "Adventure Creator" and then use ACConnector to setup your characters in your scenes. That's all :)
    There is also a demo scene to show you how it works.

    I hope this helps you further.
    If you have any questions, don't hesitate to write me an email.


    Cheer
    Stefan
     
  6. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    33
    Hi Stefan,
    I'm using RT-Voice in an app where users can choose the TTS language, that of course could be different from the current device's language. So, I'm using something like this:

    Code (CSharp):
    1. Speaker.Speak(msg, null, Speaker.VoiceForCulture(culture));
    Where culture can be "en", "it", "de", and so on.

    It works well on Windows while on Android I can't make it work properly, as if I couldn't set a culture different from the current one. So, for example, if my phone is set to Italian and culture is "en", it will result in a english sentence spoken with an italian pronunciation.

    Anyway, your demo is working correctly on my phone, so I can listen the correct pronunciations for every culture.

    Am I missing something?
     
  7. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hmm, it should work...
    Can you please try this:

    Code (CSharp):
    1.  
    2. System.Collections.Generic.List<Voice> items = Speaker.VoicesForCulture(culture);
    3.  
    4. items.CTDump(); //please see the result in the Android log
    5.  
    6. Speaker.Speak(msg, null, items[0]));
    7.  
    What is the result in the log?


    So long,
    Stefan
     
  8. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    33
    Thank you for your answer.

    The Android log just contains the error message "System.ArgumentOutOfRangeException: Argument is out of range." presumably due to null list access (item[0]).

    Anyway there's also a warning that could give a glimpse of the problem:

    04-27 19:19:13.739 8936 8960 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:906 android.content.ContextWrapper.sendBroadcast:452 android.speech.tts.TextToSpeechService$SynthThread.broadcastTtsQueueProcessingCompleted:452 android.speech.tts.TextToSpeechService$SynthThread.queueIdle:444 android.os.MessageQueue.next:392

    I'm doing these tests on a Samsung S6
     
  9. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Ok, this implies it did not found any voices for your culture...
    Samsung used it's own TTS system before the release of S7.
    Can you please try this:
    Code (CSharp):
    1. Speaker.Voices.CTDump();
    What is the result?

    You could also install "Google TTS" to prevent those problems. ;)
     
  10. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    33
    It prints nothing, and a line after there's "No voice for culture 'en' found! Speaking with the default voice!"

    But if I change language to "English" from the Android settings, it finds an english voice and speaks correctly, so it seems (at least in my case) RT-Voice cannot find a right voice when the device is set to another language.
     
  11. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Yeah, as I wrote, this is Samsung's fault.
    They wanted to roll their own TTS solution which is not 100% compatible with the standard.

    So, please install "Google TTS" from the PlayStore and you are good to go.
     
    Last edited: Apr 29, 2018
  12. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    33
    Got it, and thank you for your answers, I'll have a go with Google TTS then.
     
    Stefan-Laubenberger likes this.
  13. dlstilts

    dlstilts

    Joined:
    Sep 29, 2017
    Posts:
    30
    Hi I am trying to write an if statement to trigger an animation only when a character is speaking and when it finishes reading text the animation stops. I am using the example with crazy eyes and I am not sure where to put the code for this to work? Do have any suggestions on how to do this? Thanks!
     
  14. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hi

    Do you use SALSA?
    If so, you don't need anything special, it will handle the mouth positioning etc.

    Otherwise, you could register the callbacks "OnSpeakStart" and "OnSpeakComplete" to controll you animation.
    For more, please see the documentation, chapter 5.2.7:
    https://www.crosstales.com/media/data/assets/rtvoice/RTVoice-doc.pdf


    Cheers
    Stefan
     
  15. dlstilts

    dlstilts

    Joined:
    Sep 29, 2017
    Posts:
    30
    Hi yes I am using Salsa for the lips which works great but I made a hand gesture animation I want to play only when speaking. I went into the speak.cs script for the salsa demo and I can not find OnSpeakComplete? When I add it in like in the pdf I get an error? Do you know where I might call if Speak.OnSpeakComplete { bool = true} or something like that. Thanks! Sorry im a bit new at this.
     
  16. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hello again

    No, just do it like in 5.2.7.
    1. Create a script
    2. Add the subscribe to the callbacks in the "OnEnable" and unsubscribe in the "OnDisable" methods
    3. Add two methods where you handle those callbacks (= start/stop your animations)
    4. Add your script to your scene

    upload_2018-5-11_18-41-47.png
    I hope this gets you further.


    Cheers
    Stefan
     
  17. dlstilts

    dlstilts

    Joined:
    Sep 29, 2017
    Posts:
    30
    Hi I am very sorry I am doing what you say but I get loads of errors with that code even when using the rtvoice namespace? Thanks

    Error CS0246 The type or namespace name 'Wrapper' could not be found (are you missing a using directive or an assembly reference?)

    Error CS0123 No overload for 'speakStartMethod' matches delegate 'Speaker.SpeakStart' Assembly-CSharp


    Error CS0123 No overload for 'speakCompleteMethod' matches delegate 'Speaker.SpeakComplete' Assembly-CSharp

    Error CS0123 No overload for 'speakStartMethod' matches delegate 'Speaker.SpeakStart' Assembly-CSharp
     
  18. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hello again

    Can you please attach your script or send it to me via email?
    Thank you!


    Cheers
    Stefan
     
  19. dlstilts

    dlstilts

    Joined:
    Sep 29, 2017
    Posts:
    30
    Hi I have not gotten around to adding any of my own code because of the errors so this is just the code from 5.2.7- I am not sure if i should reference another script?
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. namespace Crosstales.RTVoice.SALSA
    5. {
    6.     public class speakComplete : MonoBehaviour
    7.     {
    8.         void OnEnable()
    9.         {
    10.             // Subscribe event listeners
    11.             Speaker.OnSpeakStart += speakStartMethod;
    12.             Speaker.OnSpeakComplete += speakCompleteMethod;
    13.             Speaker.SpeakNative("Hello world!");
    14.         }
    15.         void OnDisable()
    16.         {
    17.             // Unsubscribe event listeners
    18.             Speaker.OnSpeakStart -= speakStartMethod;
    19.             Speaker.OnSpeakComplete -= speakCompleteMethod;
    20.         }
    21.         private void speakStartMethod(Wrapper wrapper)
    22.         {
    23.             Debug.Log("speakStartMethod: " + wrapper);
    24.         }
    25.         private void speakCompleteMethod(Wrapper wrapper)
    26.         {
    27.             Debug.LogWarning("speakCompleteMethod: " + wrapper);
    28.         }
    29.     }
    30. }
     
    Last edited: May 14, 2018
  20. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Ok, the example missed a namespace, I will fix the documentation in the next release.
    Here is a working example:
    Code (CSharp):
    1. using UnityEngine;
    2. namespace Crosstales.RTVoice.SALSA
    3. {
    4.     public class SpeakComplete : MonoBehaviour
    5.     {
    6.         public void OnEnable()
    7.         {
    8.             // Subscribe event listeners
    9.             Speaker.OnSpeakStart += speakStartMethod;
    10.             Speaker.OnSpeakComplete += speakCompleteMethod;
    11.         }
    12.  
    13.         public void OnDisable()
    14.         {
    15.             // Unsubscribe event listeners
    16.             Speaker.OnSpeakStart -= speakStartMethod;
    17.             Speaker.OnSpeakComplete -= speakCompleteMethod;
    18.         }
    19.  
    20.         public void Start()
    21.         {
    22.             Speaker.SpeakNative("Hello world!");
    23.         }
    24.  
    25.         private void speakStartMethod(Model.Wrapper wrapper)
    26.         {
    27.             Debug.LogWarning("speakStartMethod: " + wrapper);
    28.         }
    29.  
    30.         private void speakCompleteMethod(Model.Wrapper wrapper)
    31.         {
    32.             Debug.LogWarning("speakCompleteMethod: " + wrapper);
    33.         }
    34.     }
    35. }
    36.  
    Please let me know if it works.
     
  21. dlstilts

    dlstilts

    Joined:
    Sep 29, 2017
    Posts:
    30
    Thank you for getting back. I don't get an error for "Wrapper" any more but still get these errors?
    Error CS0123 No overload for 'speakStartMethod' matches delegate 'Speaker.SpeakStart' Assembly-CSharp
    Error CS0123 No overload for 'speakCompleteMethod' matches delegate 'Speaker.SpeakComplete' Assembly-CSharp
     
  22. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hmm, I don't get it. My script above works with no problems on my side... Did you copy it directly?
    If so, which RTV and Unity version are you using?
     
  23. dlstilts

    dlstilts

    Joined:
    Sep 29, 2017
    Posts:
    30
    HI thanks yes I didnt think about it but this is an old project that is running on version 2.6.2 maybe that is the issue? I am a bit worried about updating because it is quite a complicated project and I don't want to break any of the other connections. Do you think that is the only way to get it working? Thanks
     
  24. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Yes, I think this causes this behaviour!
    2.6.2 was released on the 17.01.2017, so it's VERY OLD.
    Therefore, I STRONGLY recommend updating to 2.9.7.

    Just make sure you start with an empty scene and delete the folder "Assets/crosstales/RTVoice" before importing the new version.
     
    dlstilts likes this.
  25. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    410
    Hello, I am in need for a multi platform TTS solution, is this asset compatible on all platform without any restriction? (Pc/mobile/browser)
     
  26. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Yes, it works on all platforms!
    For the browser, MaryTTS is needed, but everything is explained in the docs.
     
    Gekigengar likes this.
  27. aidiamx

    aidiamx

    Joined:
    Jun 25, 2017
    Posts:
    2
    Hi! I've been trying to do a run-time text-to-speech along with salsa lip-sync. Sound comes out, however, the lips do not move when the sound comes out. Am I missing something?

    Kind regards,


    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;
    using Crosstales.RTVoice;
    using System.IO;

    public class WebText : MonoBehaviour {

    public string VoiceName;
    public string texto;
    public AudioSource textAudioSource; //not sure if I need this

    public void Start()
    {
    StartCoroutine(Check());
    }

    public void Speak (){
    Speaker.Speak(texto, null, Speaker.VoiceForName (VoiceName));
    }

    private IEnumerator Check()
    {
    WWW w = new WWW("http://institutoaidia.com/text2automate.php");
    yield return w;
    if (w.error != null)
    {
    Debug.Log("Error .. " +w.error);

    }
    else
    {
    Debug.Log("Found ... ==>" +w.text +"<==");

    texto = w.text;
    }

    Speak ();
    }
    }
     

    Attached Files:

  28. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    570
    Hi.
    Am loving RT-Voice so far. I just upgraded to 2018.2 beta (from 2017.03) and when I build my android app, it's suffering SIGSEGV shortly after startup, the line after mentioning Google TTS. I've not investigated properly yet but wanted to check it's expected to work ok?
    Thx
     
  29. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hi

    You must add the AudioSource from SALSA to the Speak-call:
    Speaker.Speak(texto, textAudioSource, Speaker.VoiceForName (VoiceName));

    This should solve the problem.
     
  30. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hi

    I think this is a problem with the beta version of Unity.

    Unfortunately, we only support official releases, so please use 2018.1.
    However, we will take a look into it in the next few days and test it with 2018.2.
     
    Arkade likes this.
  31. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    570
    Fair. Thanks for the speedy answer. I think I'll stick with the beta for a bit in the hope that maybe you pull a rabbit out of a hat :) I understand though if not. Thanks again.
     
  32. aidiamx

    aidiamx

    Joined:
    Jun 25, 2017
    Posts:
    2
    Nice! Thank you so much, it worked.
     
    Stefan-Laubenberger likes this.
  33. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    570
    Hi, just wanted to let you know RT-Voice was not the cause of my problem in 2018.2 beta -- it's working fine now. Sorry to bother you. It /was/ the last thing mentioned before crash but I found it was actually GvrIntent causing the crash. Thx and sorry again :)
     
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    No problem, thank you for letting me know!

    Have fun with RTV! ;)
     
    Arkade likes this.
  35. rayhero

    rayhero

    Joined:
    Jul 28, 2014
    Posts:
    3
    Hi stefan:
    Does RTVoice support other language in oculus go? I can build the SpeechText sample on android phone and can hear en/zh-tw speech on android phone. I can hear english speech if I set the "Voice Name Android" to en. But I can not hear the chinese speech from Oculus go after I set the "Voice Name Android" to zh-tw on oculus go. How can I integrate RTVoice with other language on oculus go?
     
    Last edited: May 23, 2018
  36. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hi Ray

    Unfortunately, we don't own a "Oculus Go"...
    Do you wait for the callback "OnVoicesReady" before accessing any Speaker-calls?
    If not, please do that and add this line in the callback:
    Debug.Log("All voices: " + Speaker.Voices.CTDump());

    What is the result in the log?


    Cheers
    Stefan
     
    Last edited: May 24, 2018
  37. rayhero

    rayhero

    Joined:
    Jul 28, 2014
    Posts:
    3
    Hi Stefan:
    I add below test code in the callback "OnVoicesReady":

    Code (CSharp):
    1. Debug.Log("voices number: " + Speaker.Voices.Count);
    2. for (int i = 0; i < Speaker.Voices.Count; i++)
    3. {
    4. Debug.Log("All voices " + i + " : " + Speaker.Voices[i]);
    5. }
    there only two language in oculus go Speaker.Voices and it's en and en-US.
    does there have some way to add Chinese language in oculus go by RT Voice?

    I already buy the pro version and want to use it on oculus go......
     
  38. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    As it looks, there are no other voices in "Oculus Go". You should ask them how to add new voices - that's out of our hands...

    However, we will release an updated version of RTV in a few weeks which has support for AWS Polly and they offer Chinese voices too.
     
  39. rayhero

    rayhero

    Joined:
    Jul 28, 2014
    Posts:
    3
    Stefan-Laubenberger likes this.
  40. willerid

    willerid

    Joined:
    Jun 7, 2018
    Posts:
    2
    Hi Stefan, maybe you could help me with a problem I've been having trying to get RTO working in my project. It works fine in editor, but when it comes to building it out to windows and trying to run the TTS in game, we are getting a

    "Could not find the TTS-wrapper: '..../windows/..../RTVoiceTTSWrapper.exe'" problem.

    I saw a couple of pages back that the suggestion in 2016 was to go to ConfigLoader and change the Constants.Constants.TTS_WINDOWS_EDITOR to match the path in the error. However, not only is there no such constant in the ConfigLoader.cs, but I can't seem to find it anywhere in the project. Has the procedure for fixing this bug changed, or am I just missing something simple about the whole procedure.
     
  41. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hi

    This is a very strange bug.
    Can you please send me these details:
    1. Exact path to your built exe
    2. Unity version
    3. Windows version
    4. RTV version
    Thank you!


    Cheers
    Stefan
     
  42. willerid

    willerid

    Joined:
    Jun 7, 2018
    Posts:
    2
    Thanks for the speedy reply. Yeah, I can't find much on this bug at all.

    C:/Users/username/wkspaces/Build/build_windows_225/windows/CrystalCore_Data/RTVoiceTTSWrapper.exe'
    Unity 2017.1.1f
    Windows 10
    RTV 2.9.7
     
  43. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Ok, I have still no idea...
    Is the error from your first post the actual log-entry (with "....")?

    It's probably better to send me an email - I look much more often into my inbox ;)
     
  44. Farrech

    Farrech

    Joined:
    Jan 31, 2017
    Posts:
    3
    Hi Stefan,

    I’m using your asset for an iOS application. Everything work perfectly on Mac, but when I test it on iPhone devices, I got trouble with the language of the voice.

    Here is my (very small) code :

    Code (CSharp):
    1.        
    2. void OnClickPlay()
      
    3. {
        
    4. var voices = Speaker.VoicesForCulture("fr-FR");
    5. Speaker.Speak(wordLabel, this.audioSource, voices[0]);
    6. }
    7.  
    On iPhone I got the labels read with an English voice, despite the indication of culture « fr-FR » that I wrote in my code. I’m sure that my device language is in French and have French voices on it. Logs from the wrapper are saying that the voice used is French.

    Here is the log from the wrapper :

    {Uid='da64ff5b-21b6-45de-8837-9403abf83359', Text=‘Baguette’, Source='True', Voice='Voice {Name='Daniel', Description='iOS voice: Daniel fr-FR', Gender='MALE', Age='unknown', Culture='fr-FR'}', SpeakImmediately='True', Rate='1', Pitch='1', Volume='1', OutputFile='', Created='06/22/2018 12:58:35'}


    I tried without specifying the audioSource and /or the voices, it’s still working on Mac but have no effect with my issue on mobile device.

    Do you have any clues about this issue ?

    Thanks, and sorry for my eventual bad English expression.
     
  45. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hi

    This is strange, Daniel is not a French voice at all!

    Please add the attached script to your scene and send me the result from the log from your iOS device (look for "+++ Voices ready +++").
    Can you please also tell me your iOS, Unity and RT-Voice version?


    So long,
    Stefan
     

    Attached Files:

  46. Farrech

    Farrech

    Joined:
    Jan 31, 2017
    Posts:
    3
    Thanks for you quick response.

    I use Unity 2017.3.1p2 64bit, my iOS device is on version 10.3.3, and I have the latest RT-Voice version (2.9.8).

    Here is a part of the logs I got (I don’t think you will need all the found voices) :


    Voice {Name='Daniel', Description='iOS voice: Daniel en-GB', Gender='MALE', Age='unknown', Culture='en-GB'}
    Voice {Name='Daniel', Description='iOS voice: Daniel fr-FR', Gender='MALE', Age='unknown', Culture='fr-FR'}
    Voice {Name='Daniel (premium)', Description='iOS voice: Daniel (premium) fr-FR', Gender='MALE', Age='unknown', Culture='fr-FR'}


    So there is apparently a French ‘Daniel’ and another one English. But, when I write Speaker.VoicesForCulture("fr-FR"), the English one it’s not suppose to be find ?

    I still don’t understand why I hear the GB Daniel while the wrapper's logs show FR Daniel. Do you have any idea ?

    Thank you again,

    Farrech
     
  47. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    I see the problem... The match in our iOS-wrapper only uses the name, so it always finds the English version of Daniel...
    We already use another approach for 2.9.9, but it's not ready for release. Do you have the PRO version of our asset? If so, I could send you the latest version with a fix.

    You could use "VoiceForName" (with the desired voice) as an alternative on iOS.
     
    Last edited: Jun 22, 2018
  48. Farrech

    Farrech

    Joined:
    Jan 31, 2017
    Posts:
    3
    Hello Stefan,

    Thank you for you reply. I don't have the PRO version. Do you know when the next version of your asset will be released ? I'll use "VoiceForName" until this moment.

    Thank you again for the support.
     
  49. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,283
    Hi

    You're welcome!

    We will release the new version of RT-Voice next month, but I can't say exactly when...
    As usual, I will post it in this thread ;)


    So long,
    Stefan
     
  50. mengux

    mengux

    Joined:
    Jan 12, 2018
    Posts:
    7
    Hi Stefan,

    If you are still checking this poster. I have a very basic question.
    When I try to change pitch, I changed the number(e.g. 1.5f), but the voice pitch is not actually change.

    public float pitch;
    public string VoiceName;
    public void Speak()
    {
    Speaker.Speak(Text.text, null, Speaker.VoiceForName(VoiceName),true,1f,pitch,1f);
    }

    But when I use the method in Youtube tutorial, something like:

    <prosody pitch="+50%">This is 50% higher.</prosody>

    The voice pitch did change.

    Wondering why the first way didn't work. I checked your previous poster, it seems the first method should work.