Search Unity

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

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

  1. AaronOjeda

    AaronOjeda

    Joined:
    Oct 31, 2017
    Posts:
    4
    As you said, after updating it worked. Thanks a lot.
     
    Stefan-Laubenberger likes this.
  2. LumoKvin

    LumoKvin

    Joined:
    Sep 28, 2019
    Posts:
    195
    The first time that the audio is played, it reads properly. The second time, it spells the word. For example, it would spell "v", "o", "i", "c", "e", instead of saying "voice".

    Edit: I think I figured it out. The string had a misspelled word in it.
     
    Last edited: Feb 15, 2020
    Stefan-Laubenberger likes this.
  3. 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.  
     
  4. jason416

    jason416

    Joined:
    Nov 8, 2018
    Posts:
    14
    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?
     
  5. Boopnetic

    Boopnetic

    Joined:
    Jul 31, 2018
    Posts:
    1
    Hi!

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

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    880
    Hi here

    i got Speaker.OnSpeakCurrentWord work only with Speaker.SpeakNative

    how use with SpeechText or pass the SpeakNative in AudioMixer

    thank's
     
  7. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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".
     
  9. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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".
     
  10. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    We've just released version 2020.1.1 of RT-Voice.
    Main changes:
    • Speaker; default of parameter "isFuzzy" changed to false in:
      • VoiceForCulture
      • VoicesForCulture
      • VoiceForGender
      • VoicesForGender
    • iOS: Silence(uid) works now as expected
    • SAPI Unity: Silence(uid) works now as expected
    • ReminderCheck removed
    • Updated to Common 2020.1.2
     
    Bartolomeus755 likes this.
  11. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    The new version is in the store!
     
    Bartolomeus755 likes this.
  12. Anshadow88

    Anshadow88

    Joined:
    Sep 15, 2018
    Posts:
    1
    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
  13. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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
     
  14. 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
     
  15. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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
     
  16. 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
     
  17. 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
     
  18. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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.
     
  19. 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?
     
  20. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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?
     
  21. 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?
     
  22. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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.
     
  23. bhermer

    bhermer

    Joined:
    Jun 24, 2013
    Posts:
    20
    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?
     
  24. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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.
     
  25. bhermer

    bhermer

    Joined:
    Jun 24, 2013
    Posts:
    20
    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?
     
  26. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    We've just released version 2020.1.2 of RT-Voice.
    Main changes:
    • Windows: resilience for buggy voices improved
    • SAPI: integration improved
    • Improvements for macOS and Linux editors
     
  27. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    The new version is in the store!
     
  28. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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
     
  29. Boliver0482

    Boliver0482

    Joined:
    Oct 19, 2019
    Posts:
    4
    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.
     
  30. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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
     
  31. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,608
    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?
     
  32. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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
     
  33. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,608
    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?
     
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,428
    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.
unityunity