Search Unity

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

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

  1. LumoKvin

    LumoKvin

    Joined:
    Sep 28, 2019
    Posts:
    195
    I am not getting any sound. The bool is false when TTS() is called. I am not the best programmer in the world but I think I did this properly. Do you see any mistakes?

    Code (CSharp):
    1. // TTS
    2.    bool isTTSReady = false;
    3.    public void TTS ()
    4.    {
    5.        print(isTTSReady);
    6.        if (isTTSReady)
    7.        {
    8.            Speaker.SpeakNative(challenge, Speaker.VoiceForGender(Crosstales.RTVoice.Model.Enum.Gender.FEMALE, language, 0, fallback));
    9.        }
    10.    }
    11.    public void OnEnable()
    12.    {
    13.        Speaker.OnVoicesReady += VoicesReady;
    14.        Speaker.OnSpeakStart += SpeakStart;
    15.        Speaker.OnSpeakComplete += SpeakComplete;
    16.    }
    17.    public void OnDisable()
    18.    {
    19.        Speaker.OnVoicesReady -= VoicesReady;
    20.        Speaker.OnSpeakStart -= SpeakStart;
    21.        Speaker.OnSpeakComplete -= SpeakComplete;
    22.    }
    23.    private void VoicesReady ()
    24.    {
    25.        isTTSReady = true;
    26.    }
    27.    private void SpeakStart (Crosstales.RTVoice.Model.Wrapper wrapper)
    28.    {
    29.        print("SpeakStart: " + wrapper);
    30.        isTTSReady = false;
    31.    }
    32.    private void SpeakComplete (Crosstales.RTVoice.Model.Wrapper wrapper)
    33.    {
    34.        print("SpeakComplete: " + wrapper);
    35.        isTTSReady = true;
    36.    }
    37.  
     
  2. jason416

    jason416

    Joined:
    Nov 8, 2018
    Posts:
    31
    Would it be possible to add functionality into the iOS wrapper to get some basic ability to interpret in-line emphasis like pitch and speed, pause, per word or phrase? Unless I'm mistaken, I think any markup would need to be converted to Speech Utterance properties within the wrapper? Or is there a way to this with OnSpeakCurrentWord?
     
  3. Boopnetic

    Boopnetic

    Joined:
    Jul 31, 2018
    Posts:
    2
    Hi!

    Could you please consider adding support for WellSaidLabs TTS voices? They have an API you can request.
     
  4. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    Hi here

    i got Speaker.OnSpeakCurrentWord work only with Speaker.SpeakNative

    how use with SpeechText or pass the SpeakNative in AudioMixer

    thank's
     
  5. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    The implementation on iOS doesn't support SSML (blame Apple ;)).
    So you can't really modify a single word in a sentence.
     
  6. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    We will add that to our backlog, but I can't promise anything atm.
    The release of the IBM Watson provider is currently our priority.

    However, if you like, you could implement it on your own. RT-Voice is extensible; please take a look at the "VoiceProviderExample.cs".
     
  7. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Yes, that's exactly the case.
    If you want to get the audio inside Unity, please take a look at the demo scene "04-Simple".
     
  8. Anshadow88

    Anshadow88

    Joined:
    Sep 15, 2018
    Posts:
    2
    Hi... I love ur asset... I am a teacher, trying to make a game of physics that shows animation, talks to students and shows subtitles at d same time... I was using your "currentword" function to write the subtitles... But it wont work on my android build... Any workaround of that? I am a novice programmer... Please let me know if there is a way....

    PS: previously, I wrote the whole line in subtitle and moved the text leftwards to show the subtitle on the screen... But it didnt sync perfectly with the audio...

    Thanks again for the awesome product
     
    Last edited: Mar 21, 2020
  9. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Thank you for your kind words!

    Unfortunately, the built-in TTS from Android is quite simplistic and doesn't provide a callback for the current word.
    In fact, only iOS and Windows provide this functionality as described in chapter 2.51 from the documentation:
    https://www.crosstales.com/media/data/assets/rtvoice/RTVoice-doc.pdf

    upload_2020-3-21_20-58-22.png

    Stay safe!


    Cheers
    Stefan
     
  10. sreejithcodes

    sreejithcodes

    Joined:
    Feb 20, 2020
    Posts:
    5
    Hi i am trying to create a text to speech from file. I tried a lot but for some reason there is no voice and I have actually installed the latest software but running unity 2019. Whatever I do it shows error. I am new to all this but I installed RT. I have a character that is already present and all animation completed. I am able to do the salsa without RT too. For some reason there is no voice. I tried the documentation and followed by adding the RT Voice and then trying to link it to my character. Tried the videos online from your channel but still there is no voice. I tried the simple RT Voice basic tutorial video as it is in 2019 and 2018 and 2017 versions and still the voice wont play. I tried the script provided in the beginning and that also doesnt work please let me know what i can do so i can get it completed
     
  11. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Some questions
    1. Did you try our demo scenes? Are they working?
    2. What's your exact Unity version?
    3. What's your operating system
    4. What's the version of RT-Voice?
    Apart from that, you will need the "TextFileSpeaker"-prefab in the scene and add the text files there.


    So long,
    Stefan
     
  12. sreejithcodes

    sreejithcodes

    Joined:
    Feb 20, 2020
    Posts:
    5
    1. No I did not i will try that

    2. I have unity 2018 4.18f1 and unity 2019 3.3f1 both i have tried it on

    3. Windows 10

    4. Latest from the asset store. I bought it a week back. I tried older version i found online too
     
  13. sreejithcodes

    sreejithcodes

    Joined:
    Feb 20, 2020
    Posts:
    5
    I tried the demo today and even in that there is no sound. I can see in the demo that the voices are being played in the spectrum but there is no voice at all. Please help
     
  14. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Are you sure you can hear any audio from your Unity?
    Because this sounds strange; if you see the the spectrum, that means there is audio played and decoded.
     
  15. sreejithcodes

    sreejithcodes

    Joined:
    Feb 20, 2020
    Posts:
    5
    I havent tried any other i think i did sample salsa and even that was not played I mean there was no audio for that also. Any idea why that might be? Any help would be welcome?
     
  16. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    I know it sounds silly, but do you hear any audio on your PC, like from Youtube etc.?
    If so, can you please add an audio source into your scene, add an audio clip to it and enable "Play On Awake". Do you hear the sound?
     
  17. sreejithcodes

    sreejithcodes

    Joined:
    Feb 20, 2020
    Posts:
    5
    Ok seems like audio card setting was wrong i got it fixed. Working with salsa and RTvoice. I linked it and i can actually get it to speak now with salsa lip sync and everything but i am not able to link the input field and button created with the RTVoice basic tutorial style with that of salsa lip sync. Can you let me know if its possible?
     
  18. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Sure, you could do it like this:
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using Crosstales.RTVoice;
    4.  
    5. public class Speak : MonoBehaviour
    6. {
    7.     [Tooltip("Origin AudioSource from SALSA.")]
    8.     public AudioSource Source;
    9.  
    10.     [Tooltip("Field with the text to speak.")]
    11.     public InputField EnterText;
    12.  
    13.     public void Talk()
    14.     {
    15.         Speaker.Silence();
    16.  
    17.         if (EnterText != null)
    18.             Speaker.Speak(EnterText.text, Source, Speaker.VoiceForCulture("en"));
    19.     }
    20. }
    Just add the script to a gameobject and use the "Talk"-method in the "OnClick"-callback from the button.

    I hope this helps you further.
     
  19. bhermer

    bhermer

    Joined:
    Jun 24, 2013
    Posts:
    28
    Hi,

    I hope you can help, we've updated our app from 2017.4 to 2018.3 and updated to the latest version on asset store to fix a bug for IOS users where there were no voices in IOS 13. This fixed the IOS bug, but now our Android version doesnt work (works for Windows, and IOS) the error on start up is

    java.lang.ClassNotFoundException: com.crosstales.RTVoice.RTVoiceAndroidBridge

    Any ideas?
     
  20. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Have you followed the upgrade notes in chapter 6:
    https://www.crosstales.com/media/data/assets/rtvoice/RTVoice-doc.pdf

    If so, please make sure you delete the content of the build folder and try it again.
     
  21. bhermer

    bhermer

    Joined:
    Jun 24, 2013
    Posts:
    28
    Yes. I followed this, and it works fine for iOS and Windows. I can try doing the delete again I guess. Any idea which of the components would be causing this?
     
  22. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Yes, the latest version of RT-Voice runs with Android and IL2CPP.

    We deprecated the non-PRO version over 1.5 years ago:
    https://forum.unity.com/threads/rt-...o-speech-solution.340046/page-17#post-3601527

    But you can upgrade to PRO for a reduced price:
    https://assetstore.unity.com/packages/slug/41068

    I hope this helps you further.


    Cheers
    Stefan
     
  23. Boliver0482

    Boliver0482

    Joined:
    Oct 19, 2019
    Posts:
    45
    Hello.

    Struggling to make Speaker.Speak TTS audio pause on iOS. This works fine on Android and in Editor. No error or other output is thrown, but the audio continues regardless.

    I am using Speaker.Pause() with no UID. Is this a know limitation of iOS?


    Many Thanks,


    Bob.
     
  24. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi Bob

    In the current version, "Pause" only works for "Speak"-calls with real AudioSources, Since iOS can't generate audio files, the "Speak"-call always ends up as "SpeakNative", which can't be paused on any platform.

    However, we will try to solve this; please send us your invoice via email and we will give you access to the new version as soon as we have a fix for it.

    Stay safe!


    Cheers
    Stefan
     
  25. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    We've been using RTVoice for a while with the native Windows and Mac voices, but now we want to try and make our app sound the same regardless of platform. I know RTVoice supports a lot of speech sources, but I'm a bit overwhelmed and could use some advice.

    What are our options for voices that sound as good as (or better than?) the Apple/Microsoft voices, but will work cross-platform?
     
  26. Stefan-Laubenberger

    Stefan-Laubenberger

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

    There are three fantastic online services:
    1. AWS Polly
    2. Azure (Bing Speech)
    3. Google Cloud Speech
    Imho, 1&2 sound far better than any built-in TTS voice.
    RT-Voice has providers for each of them, so no code changes needed. :)

    I hope this helps you further.

    Stay safe!


    Cheers
    Stefan
     
  27. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Thank you. That does help. One follow-up question, if you don't mind: I see that AWS Polly's licensing allows you to store the generated sound files and replay them later as much as you like. I'd like to take advantage of that to cache basically everything we say (our app tends to say the same thing over and over), partly for performance but mostly to keep the cost down.

    Is that caching something I will be able to do via RT-Voice?
     
  28. Stefan-Laubenberger

    Stefan-Laubenberger

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

    RTV hasn't a built-in cache; we tried this for a long time, but the requirements of our customers make this an extremely difficult task...

    However, there is nothing holding you back from rolling your own solution. If you take a look at the API, you will see that the "Speak"-call has a parameter called "outputFile":
    https://www.crosstales.com/media/da...ass_crosstales_1_1_r_t_voice_1_1_speaker.html

    You can use those files to populate your cache. E.g. every text has an id, so you look up the file with its id; if it's there, play it. If not, call "Speak" with id as "outputFile".

    You can also use our "AudioFileGenerator" to create all static dialogs in advance and include the generated audio files in your build.

    I hope this helps you further.


    Cheers
    Stefan
     
    JoeStrout likes this.
  29. erictruitt

    erictruitt

    Joined:
    Aug 2, 2017
    Posts:
    1
    Hello,

    I’m the Tech Lead on a team creating a AR mapping solution for users with different types of disabilities and I’m interested in integrating your RT-Voice Pro Unity Asset into our project. I have a couple questions before I make the purchase that I was hoping you could answer.

    1) Is your Instant Text-to-Speech feature supported on Android?

    2) Am I correct in my understanding that using your Asset, I would be able to convert text that my app generates during runtime into Speech during runtime that I could then assign a AudioSource to enable 3D sound settings on Android?

    Thanks for your help in answering these questions for me. I have not been able to find a Text to Speech solution for Android that allows me to specify a AudioSource to enable 3D Audio on Android, so I am hopeful that you have the solution I need.

    Thank you
     
  30. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi Eric

    Thank you for your interest in RT-Voice!

    Here are the answers to your questions:
    1. Yes, RT-Voice works on Android
    2. Also yes, RT-Voice uses AudioSources as output and you can place them in 3D space

    I hope this helps you further.

    Stay safe!


    Cheers
    Stefan
     
  31. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
    Hi, I see your product and become interested in purchase it.
    But I have a question.
    I have a game with different languages on it. My game supports English, Portuguese, French, German and Chinese. Is it possible to create a voice for my characters using your asset?
     
  32. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Thank you for your interest in RT-Voice!

    Our asset doesn't create any voices, it uses either the built-in TTS voices or online solutions like MaryTTS, AWS Polly etc.
    You can theoretically create your own voice in MaryTTS, but it's quite a bit of work:
    https://github.com/marytts/marytts/wiki/HMMVoiceCreation

    However, I would recommend sticking with the available options.

    I hope this helps you further.

    Stay safe!


    Cheers
    Stefan
     
  33. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
  35. danbg

    danbg

    Joined:
    May 1, 2017
    Posts:
    64
    Hello, I'm getting a very strange behaviour after updating to Unity 2019.3.12.

    "using Crosstales.RTVoice;" gives an error and is not found. Only "using Crosstales.NAudio;" appears.

    Everything was working with Unity 2019.3.11... Not sure what is creating this issue...
     
  36. Stefan-Laubenberger

    Stefan-Laubenberger

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

    What happens if you follow chapter 10 of the documentation and re-import the whole package?


    So long,
    Stefan
     
  37. danbg

    danbg

    Joined:
    May 1, 2017
    Posts:
    64
    Yes, I did and it seems RTVoice is not being loaded. In fact it's happening even with a totally new installation in a clean project. I tested in 2019.3.11 and everything works as expected, but using 2019.3.12 I cannot access to Crosstales.RTVoice or Speaker in any script, beyond those in the demos, where everything works as usual. The strange thing is that RTVoice prefabs work, along the demos, but it cannot be used in scripts.

    The same is happening with old versions of RTVoice, none of them load (although I haven't tested all) Maybe it has something to do with the new changes in Unity 2019.3.12 https://unity3d.com/es/unity/whats-new/2019.3.12
     
    Last edited: May 1, 2020
  38. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    That's strange, I did the some tests with Unity 2019.3.12 under Windows and it works.
    What's your OS?

    Anyway, what happens if you delete the "crosstales" asmdef:
    upload_2020-5-1_14-48-1.png
     
  39. danbg

    danbg

    Joined:
    May 1, 2017
    Posts:
    64
    Hi, I'm using Windows 10 1909. I deleted crosstales.asmdef and nothing changed... I don't know what is going on, this issue is only happening with RTVoice, every other assets are working nicely. I had to downgrade to Unity 2019.3.11 to make it work again. But if it works for you, then I guess something is wrong in my setup :( Could you try with ealier versions of RTVoice to check if they work too? Thanks.
     
  40. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Sure, I can test an older version of RT-Voice, which one are you using?

    However, we recommend our customers to always use the latest version.
    Our products are always backward compatible so you could update without any hassle.
    There's also a dedicated tab to check for updates:
    upload_2020-5-1_16-59-9.png
     
  41. danbg

    danbg

    Joined:
    May 1, 2017
    Posts:
    64
    I have tried it with 2020.1.2 and 2019.6.2, both vanilla and with my mods. I'm not sure why, but sometimes when I import it, EditorDefaultResources appears along Plugins folder to import, but sometimes just Plugins folder appears.

    I've made some customizations, so I'd rather not update beyond 2020.1.2 (I got that working in Unity 2019.3.11 in my project). Everytime I update I have to change plenty of things and it's a bit tedious, and when I join eveything in my main project, there are also other assets involved that created some conflicts with RT-Voice in the past.
     
  42. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hmm, that's strange; updating should not result in any work.
    Did you follow chapter 10 of the documentation:
    https://www.crosstales.com/media/data/assets/rtvoice/RTVoice-doc.pdf

    Anyway, RT-Voice moves icons after the first install to the "EditorDefaultResources" folder; therefore, when you update later on, the package importer knows the new destination.
     

    Attached Files:

  43. danbg

    danbg

    Joined:
    May 1, 2017
    Posts:
    64
    Don't worry Stefan, I followed chapter 10 but it remains the same. I will try in some other computers to see if it works, but I guess that if it works for you, it should be something regarding my setup and only affecting me. Anyway, I'll see if with the next Unity 2019.3.13 it works, in the meantime I will remain in Unity 2019.3.11. There everything works great :)

    My problem with upgrading RT-Voice is not due to RT-Voice, but with relatively old code I'm using regarding TUIO and custom hardware controllers, and everytime I update RTVoice I have to change many things in your code because it get some conflicts. (your code is much better made and it's easier to change and adapt)

    Thanks and congratulations for this asset, it makes much easier to work with TTS and combine it with voice recognition.
     
    Stefan-Laubenberger likes this.
  44. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Please let me know if it works on other machines.
    I'm glad RTV is useful for you! If you like the asset/support, please rate us in the store, it's very much appreciated!

    Stay safe!


    Cheers
    Stefan
     
  45. idibil

    idibil

    Joined:
    Oct 10, 2015
    Posts:
    24
    Hi Stefan,

    I updated my RT-Voice to the latest version. I am using Unity 2018.4.21f1
    When I apply the AWS pack I get this issue:

    • Assets\Plugins\crosstales\RTVoice\3rd party\AWS Polly\Scripts\VoiceProviderAWS.cs(136,15): error CS0246: The type or namespace name 'Amazon' could not be found (are you missing a using directive or an assembly reference?)
    • Assets\Plugins\crosstales\RTVoice\3rd party\AWS Polly\Scripts\VoiceProviderAWS.cs(36,70): error CS0246: The type or namespace name 'Amazon' could not be found (are you missing a using directive or an assembly reference?)
    • Assets\Plugins\crosstales\RTVoice\3rd party\AWS Polly\Scripts\VoiceProviderAWS.cs(35,15): error CS0246: The type or namespace name 'Amazon' could not be found (are you missing a using directive or an assembly reference?)
    What can be the problem?
     
  46. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Hi, very interested in this, but the WebGL demo doesn't seem to work on Mac Safari (v12.1.2), and throws an error, below. It does work great on MacOS with Chrome and Firefox browsers, and the Mac standalone build. Should it work on Safari?

    An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
    NotSupportedError: The operation is not supported.
     
  47. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Have followed chapter 10 in the documentation:
    https://www.crosstales.com/media/data/assets/rtvoice/RTVoice-doc.pdf

    That should solve the problem, please let me know.


    So long,
    Stefan
     
  48. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Hi gecko

    Thank you for your interest in RT-Voice!

    I have currently no Mac available, but it's possible that it doesn't work since we used quite an old Unity (2017.4.38) to build the WebGL-version.
    I don't know if Unity WebGL builds are supported in Safari, but I will check it asap.


    Cheers
    Stefan


    Edit:
    @gecko I've updated the demo, please give it a try:
    https://www.crosstales.com/media/data/assets/rtvoice/webgl/
     
    Last edited: May 3, 2020
  49. idibil

    idibil

    Joined:
    Oct 10, 2015
    Posts:
    24
    Hi Stefan,

    I followed the chapter 10 two times, the first before posting the problem, and the second (even deleting the common) this morning. But RT Voice is not the problem, errors arise when I install AWS third party and only with that script: VoiceProviderAWS.cs

    EDIT: Fixed, it was necessary to unpack AWSPolly_Unity2017. I thought that it was for Unity 2017, but it is for 2018 too.
     
    Last edited: May 3, 2020
  50. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,976
    Yes, that's true. There are three packages inside the "Installer"-folder:
    upload_2020-5-3_11-13-41.png

    The first is for Unity 2017&2018 and the others are for Unity 2019&2020 depending on the .NET-framework.

    However, the strange thing is this: we created a script called "ZInstaller" which should automatically install the correct SDK without any additional steps. I just verified this with my Unity 2018.4.21 under Windows and it worked...
    Are you working under macOS or Linux?

    Anyway, I assume apart from that, AWS Polly is working?