Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

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

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

  1. Mayckon_Jhonatas

    Mayckon_Jhonatas

    Joined:
    Apr 19, 2019
    Posts:
    9
    how can i implemente the azure in my app? someone can explain to me please?
     
  2. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    You have to install the "Azure.unitypackage" from "Assets\Plugins\crosstales\RTVoice\3rd party".
    Afterwards, generate an API key and add it (and the "Endpoint"-urls) to the "Azure"-object:
    upload_2021-3-28_19-10-34.png

    Finally, add it as "Custom Provider" to RT-Voice:
    upload_2021-3-28_19-12-26.png

    That's all.
     
  3. Mayckon_Jhonatas

    Mayckon_Jhonatas

    Joined:
    Apr 19, 2019
    Posts:
    9
    Can you show me how to criate correctly the azure key on the azure portal? I'm having some problems in this process and I'm not find anywhere a tutorial.
     
  4. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    I also barely remember, sorry...
    However, you have to activate "Cognitive Services" under https://portal.azure.com/#home and add the keys (under "Manage keys"):
    Azure.png
    I hope this helps you further.
     
  5. Mayckon_Jhonatas

    Mayckon_Jhonatas

    Joined:
    Apr 19, 2019
    Posts:
    9
    I found the api "key" and "endpoint". But where can i find the "request uri" ?
     
    Last edited: Mar 28, 2021
  6. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    You can tinker it together based on your endpoint - it has always the same schema.

    An example:
    https://westus.api.cognitive.microsoft.com/sts/v1.0/issueToken
    https://westus.tts.speech.microsoft.com/cognitiveservices/v1

    The bold text represents your region or endpoint - if you have another one, let's say "eastasia", the enpoint and request uri will become this:
    https://eastasia.api.cognitive.microsoft.com/sts/v1.0/issueToken
    https://eastasia.tts.speech.microsoft.com/cognitiveservices/v1


    For more, see this link:
    https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/regions
     
  7. Mayckon_Jhonatas

    Mayckon_Jhonatas

    Joined:
    Apr 19, 2019
    Posts:
    9
    thanks a lot! this solved my problem.
     
    Stefan-Laubenberger likes this.
  8. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    If you like our tool/support and given you find some time, a nice review is always appreciated ;)
     
  9. Mayckon_Jhonatas

    Mayckon_Jhonatas

    Joined:
    Apr 19, 2019
    Posts:
    9
    Code (CSharp):
    1. public void anunciar()
    2.     {
    3.      
    4.         Speaker.Speak(anuncioPCText.text, null, Speaker.VoiceForName(VoiceName));
    5.  
    6.     }
    i'm having problem here. i can't add a voice name. what could i do? i'm using the azure api.
     
  10. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    What happens?
     
  11. Mayckon_Jhonatas

    Mayckon_Jhonatas

    Joined:
    Apr 19, 2019
    Posts:
    9
    I followed your tutorial but, I am not able to call the function to convert the text to audio.
     
  12. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    Can you try it with our demo from the Azure-folder? If it doesn't work, do you see any errors in the console?
     
  13. AaronOjeda

    AaronOjeda

    Joined:
    Oct 31, 2017
    Posts:
    7
    Hi Stefan,

    Thank you for the answer, it is clarifying indeed.

    I was aware of those two different panels, but some voices that I have downloaded from the UWP panel are visible in the SAPI5 panel. When I download a new voice I don't have the option to specify my preferred TTS-system so I guess each voice has its own format and I can't install this specific voice for SAPI5.

    I have read some post about using these voices for UWP as SAPI5 voices by editing the Registry. Have you heard something about this? Anyway maybe I'll try it. Thanks again!

    Regards
    Aaron.
     
  14. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    You can install free and commercial voices, like from Cereproc etc.
    However, please let me know your findings.
     
    Last edited: Apr 6, 2021
  15. chgeorgiadis

    chgeorgiadis

    Joined:
    Jan 30, 2018
    Posts:
    32
    A quick resume. I have two Avatars (female/male) on Android on different scenes with Salsa for Lip sync and RT Voice and i want to give the appropriate gender voice to both them. Due to Android's limitation (can not define gender) i am using the Google TTS asset. Is that possible?
    Any short suggestion (maybe with bullets) how to achieve that? I am working on demo RT-Voice and Google TTS for now but i didnt manage to implement with Salsa. If it helps i would like to use en-GB-Standard-A and en-GB-Standard-B for female and male respectively. Thank you!
     
    Last edited: Apr 10, 2021
  16. Stefan-Laubenberger

    Stefan-Laubenberger

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

    You could manually check the voices for the gender under Android and use them instead of Google TTS. However, if you want to have the same voices everywhere, this is certainly the right way.

    About SALSA: did you see our demo scenes? If not, please take a look at them.
    The basics are like this:
    1. The "SALSA"-component needs an audio source, which is normally added on the same gameobject
    2. The "Speak"-method from RT-Voice has a parameter for the audio source.
    3. Therefore, if you want to use SALSA and RTV together, pass the audio source to the "Speak" call
    Thats all, you can see the code in "SpeakSimple.cs":
    upload_2021-4-11_12-35-27.png

    I hope this helps you further.


    Cheers
    Stefan
     
    chgeorgiadis likes this.
  17. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    We've just released version 2021.2.0 of RT-Voice.
    Main changes:
    • UI: speak Text and InputFields
    • iOS: voice handling improved
    • Android: SSML support
    • Updated to Common 2021.2.0
    We've also updated the demo scenes to show the new speak-functionality for UI-elements.

    Furthermore, it's also on sale, grab it while you can ;)
     
  18. mshafieluru

    mshafieluru

    Joined:
    Apr 16, 2021
    Posts:
    1
    Hi
    I know this is old post, can you please share an example of Azure TTS API integration. In the documentation it is mentioned like native audio file

    Can we pass the API URL of the Azure TTS to the model ?

    Regards
    Shafi
     
  19. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    Hi Shafi

    Thank you for your interest in RT-Voice!

    Azure is fully integrated - there is even a demo scene for it :)
    You basically have to change those three parameters and add it as custom provider to RT-Voice:
    upload_2021-4-17_2-15-44.png

    That's all!
    You can test the API in our demo builds.

    I hope this helps you further.
    If you have any additional questions don't hesitate to ask.


    Cheers
    Stefan
     
  20. BarnimPL

    BarnimPL

    Joined:
    Nov 22, 2020
    Posts:
    6
    Hi All!

    I just bought the plugin and I have a problem with package installation, version: 2021.2.1
    Tested on new empty 3d projects in Unity 2018.4.34f, 2019.4.24 and 2020.3.4f1 / Windows10.

    Tried to hit the import button multiple times after installation. Tried restarting Unity.
    No Tools menu at the top and no RT Voice in the context menu on the Hierarchy window.
    In the console those errors:

    upload_2021-4-17_17-49-34.png

    Proof:

    upload_2021-4-17_17-47-50.png

    Maybe I did something wrong, but to be honest I don't think so.
    Please help :)
     
  21. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Thank you very much for reporting this issue!
    It's now fixed and we will release it soon.

    However, if you like to have access to the new version, please send me an email with your invoice.


    Cheers
    Stefan
     
  22. BarnimPL

    BarnimPL

    Joined:
    Nov 22, 2020
    Posts:
    6
    Thanks for a quick response! Email sent.

    Cheers,
    Maciej
     
  23. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    Fix sent ;)
     
  24. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    We've just released version 2021.2.2 of RT-Voice.
    Main changes:
    • Support for Naninovel
    • Android: fix for error in Unity Editor
    • Built-in providers improved
     
  25. simonsen

    simonsen

    Joined:
    Oct 6, 2015
    Posts:
    14
    Quick note; the new one (same as for 2021.2.1), the Demo scenes are all missing a prefab (presumably the RTVoice prefab, since that's the one I'm looking for).

    upload_2021-4-21_14-27-46.png
     
  26. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Please extract the "UI"-package from "Assets/Plugins/crosstales/Common/Extras".
    Does that solve the issue?


    So long,
    Stefan
     
  27. simonsen

    simonsen

    Joined:
    Oct 6, 2015
    Posts:
    14
    Yes, it did, thanks.
     
    Stefan-Laubenberger likes this.
  28. simonsen

    simonsen

    Joined:
    Oct 6, 2015
    Posts:
    14
    Quick bit of feedback; you might want to throw an explicit error message if the GlobalCache isn't added to the scene; atm it works fine in the editor, but will crash with an Object Reference not set on release builds. Adding the GlobalCache prefab to the scene fixes it, but debugging player builds can be a frustrating experience.



    NullReferenceException: Object reference not set to an instance of an object
    at Crosstales.RTVoice.Speaker.SpeakWithUID (Crosstales.RTVoice.Model.Wrapper wrapper) [0x00100] in <04491f5016544868b7509f3d45cc0ad6>:0
    at Crosstales.RTVoice.Speaker.Speak (System.String text, UnityEngine.AudioSource source, Crosstales.RTVoice.Model.Voice voice, System.Boolean speakImmediately, System.Single rate, System.Single pitch, System.Single volume, System.String outputFile, System.Boolean forceSSML) [0x00015] in <04491f5016544868b7509f3d45cc0ad6>:0
     
  29. Stefan-Laubenberger

    Stefan-Laubenberger

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

    This is fixed in 2021.2.3, which is currently in the review process of the store.
    If you like to have the fixed version now, please send me an email with your invoice.


    Cheers
    Stefan
     
  30. simonsen

    simonsen

    Joined:
    Oct 6, 2015
    Posts:
    14
    It's fine; fixed locally, just a bit of feedback.

    Quick question: I'm adding this to a VN, and so far just going with the system voices. I could have sworn I've downloaded and installed additional Windows System Voices, but so far I'm not seeing them show up as options when querying the system. Does it require a system restart, some kind of registration, or something else?
     
  31. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    Please see this post:
    https://forum.unity.com/threads/rt-...o-speech-solution.340046/page-29#post-6979943

    May you have them installed for the "wrong" TTS?
     
  32. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    175
    Stefan, I believe I might have seen this answer in the forum. But I can no longer find it.
    Can you do multiple/different languages?
     
  33. Stefan-Laubenberger

    Stefan-Laubenberger

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

    RT-Voice can speak ANY language as long as you provide a voice for the language.

    Please see chapter 17.1 of the documentation for an overview over the supported languages per provider:
    https://www.crosstales.com/media/data/assets/rtvoice/RTVoice-doc.pdf

    I hope this helps you further.


    Cheers
    Stefan
     
  34. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    175
    Using those voices costs money, does it not?
     
  35. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    It depends, the cloud providers like "AWS Polly", "Azure" and "Google Cloud" are subscription based but offer free tiers (afaik 1mio characters per month are free).

    MaryTTS and eSpeak are free and open source and the other providers use the voices from the device, which are also free, except you decide to buy additional voices from a 3rd party provider.
     
  36. masai2k

    masai2k

    Joined:
    Mar 2, 2013
    Posts:
    23
    Hi stefan,
    when I compile my project for Windows from a macOs, I receive these errors:

    Type '[Assembly-CSharp-firstpass]Crosstales.RTVoice.Tool.AudioFileGenerator' has an extra field 'sampleRate' of type 'Crosstales.Common.Model.Enum.SampleRate' in the player and thus can't be serialized (expected 'generateOnStart' of type 'System.Boolean')
    Type '[Assembly-CSharp-firstpass]Crosstales.RTVoice.Tool.AudioFileGenerator' has an extra field 'bitsPerSample' of type 'System.Int32' in the player and thus can't be serialized (expected 'generateOnStart' of type 'System.Boolean')

    and so on...

    Is it possible to compile my project for Windows from a macOS? Or I had to do the build form a Windows system?

    Thanks
    Massimo
     
  37. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    You're right - this is a problem that's now fixed.
    Just send me an email and I will give you the new version.
     
  38. evolvingtech

    evolvingtech

    Joined:
    May 27, 2012
    Posts:
    14
    Question regarding your Demos in RT-Voice Pro 2021.2.3... Whenever I open any of the demo scenes (like 01-Speech) in the Editor, the scene is immediately marked as having been altered, even though I have yet to make any change in the scene. Any idea why this happens?

    Then whenever I switch to another scene it asks me if I want to save changes. This becomes quite cumbersome, and I would like to eliminate this oddity if at all possible.
     
  39. Stefan-Laubenberger

    Stefan-Laubenberger

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

    The reason for this is quite simple - as soon as you open a demo scene, a "RTVoice" (and "GlobalCache") prefab are instantiated automatically (e.g. a script references these singletons).
    There's nothing to worry about.

    However, you can prevent this by manually adding those two prefabs to your scene.


    Cheers
    Stefan
     
  40. evolvingtech

    evolvingtech

    Joined:
    May 27, 2012
    Posts:
    14
    That explains it and you offer a very simple way to address it. Thanks!
     
  41. twinklapps

    twinklapps

    Joined:
    Feb 6, 2018
    Posts:
    8
    Hi @Stefan-Laubenberger,

    My team has just updated to Xcode 12.5 and we have noticed our unity build now contains an error relating to the RTVoice asset.

    We have updated to the latest Unity 2020 LTS (2020.3.6f1) and have also updated to the most recent version of the RTVoice asset on the Unity Asset Store (2021.2.3). This unfortunately didn't fix our issue. We downgraded Xcode to test that the project still worked on Xcode 12.4 and it worked completely fine.

    The issue seems to lie in the RTVoiceIOSBridge.mm file - specifically the AVSpeechSynthesizer singleton.

    Screenshot 2021-04-29 at 10.33.13.png

    I haven’t had the chance to fix this on our side just yet. But wondered whether you was aware of this issue? And can this be fixed in a newer version of the asset?

    Thanks,

    Twinkl Apps
     
  42. twinklapps

    twinklapps

    Joined:
    Feb 6, 2018
    Posts:
    8
    If anyone else is having the same issue, this seems to have fixed the issue for now. Just update the file 'RTVoiceIOSBridge.mm' in your Unity Assets folder here: 'Assets/Plugins/crosstales/RTVoice/Libraries/iOS' with this code:
    Code (CSharp):
    1. +(AVSpeechSynthesizer *) synthesizer
    2. {
    3.     if (_synthesizer == nil) {
    4.     static dispatch_once_t p;
    5.         dispatch_once(&p, ^{
    6.             _synthesizer = [[AVSpeechSynthesizer alloc] init];
    7.         });
    8.     }
    9.     return _synthesizer;
    10. }
    Here is what your changes should look like:
    Screenshot 2021-04-29 at 19.52.49.png

    I am no Objective C expert - so this is only a temporary fix to allow you to build your project.

    Shoutout to this stackoverflow thread that helped me fix this issue: https://stackoverflow.com/questions...signing-to-idavaudioplayerdelegate-from-class.

    Specifically this section:

    Screenshot 2021-04-29 at 19.59.46.png

    Thanks,

    Twinkl Apps Team
     
    Stefan-Laubenberger likes this.
  43. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,663
    Thank you very much, this is awesome!

    We will add the fix to the next release!
     
  44. delexaet

    delexaet

    Joined:
    Apr 14, 2016
    Posts:
    26
    Hey, I installed RT-Voice PRO 2021.2.3 on Unity 2020.2.1 and have an issue. All the demo scenes look like this (even after importing all the assets in the UI.unitypackage file).

    Any suggestions? Thanks in advance
     

    Attached Files:

  45. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Did you update the RT-Voice version in your project? If so, did you follow chapter 10 of the documentation:
    https://www.crosstales.com/media/data/assets/rtvoice/RTVoice-doc.pdf

    Have you also installed the "Demos.unitypackage"?


    So long,
    Stefan
     
    delexaet likes this.
  46. delexaet

    delexaet

    Joined:
    Apr 14, 2016
    Posts:
    26
    Ah didnt know there was another unitypackage called Demos. Thanks that solved my problem!
     
    Stefan-Laubenberger likes this.
  47. Boliver0482

    Boliver0482

    Joined:
    Oct 19, 2019
    Posts:
    34
    Thanks for this. Just hit the same issue (sat working in a field camping as a change of home office - so fact it quick and easy and not a big download helpful.

    Do you know when it will be a permanent fix. Seems to break all Xcode 12.5 builds. Ta.
     
  48. Boliver0482

    Boliver0482

    Joined:
    Oct 19, 2019
    Posts:
    34

    Hmm. Looks like this ir something else may have broken the speechcomplete method from firing. I'll need take a more detailed look when I'm back.
     
  49. Boliver0482

    Boliver0482

    Joined:
    Oct 19, 2019
    Posts:
    34
    Hello. So having had a look, I can confirm there is an issue in that on iOS, onspeakcomplete doesn't seem to be firing when the speech comes to a natural end, (i.e. the full strings is spoken). It does fire if you trigger a speaker.instance.silence.

    This only started happening with Xcode 12.5 and the fix suggested earlier to the RtVoiceIosBridge.mm file to allow RTVoice pro projects to compile in that version of Xcode. This is tested on an iPad running 14.4.2.

    I'm away from home so can't test with an earlier Xcode or other iOS versions.

    This doesn't impact Android or an iOS simulated session within Unity editor.

    Thanks,
    Bob.
     
  50. Stefan-Laubenberger

    Stefan-Laubenberger

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

    I think the current solution doesn't include the delegate, which will result in the issues you described.
    Unfortunately, I'm on holiday for the next 3 weeks without a Mac and therefore, my options are fairly limited.
    However, I will try to find a solution for it - please give me some time to think about it.


    So long,
    Stefan
     
unityunity