1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

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

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

?

Would you like to use "AWS Polly" (https://aws.amazon.com/polly/) in your games?

  1. Yes

    5 vote(s)
    35.7%
  2. No

    5 vote(s)
    35.7%
  3. Maybe

    4 vote(s)
    28.6%
  1. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Ok, this means it's a short text and doesn't need much time to generate.
    Just to get a better feeling: you said you've got 15'000 users and a "handful" experience this lags, right?
    Do you know their specs, are those old/low-performance PCs?

    My idea: if you detect a slow machine, switch from the Speak-call to SpeakNative. It uses the same parameters and is faster. But you lose the functions for an AudioSource, like effects and 3D-positional audio.
    Here are the details:

    https://www.crosstales.com/media/da...ass_crosstales_1_1_r_t_voice_1_1_speaker.html
     
    wstelzle and HamFar like this.
  2. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    65
    We don't actually need positional audio or effects for announcements. Does speaknative avoid using the wrapper exe and therefore circumvent the issue?
    It's difficult for us to judge how many people actually have this problem as the majority knew about the problem in our previous release and disabled the announcements, so those that are hitting it tend to be new users, which is why I think we are seeing lower volumes as opposed to the whole user base hitting it at once which was what happened when we first released the voice announcements feature.
     
  3. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    No, SpeakNative also needs the exe, but it doesn't generate audio files (which then have to be loaded into Unity). This makes it quicker.
    To avoid the wrapper-exe, you have to use MaryTTS.

    But I'm really interest in the reasons for the lags since our exe is very simple and should never cause any noticeable delays... :confused:
     
    Last edited: Jul 1, 2017
    wstelzle likes this.
  4. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    65
    Would using MaryTTS also work on OSX as well as Windows? .... just looking at how I can move to a position of safety for my next update until we work out what is happening.
     
  5. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Yes, MaryTTS works on ALL platforms, but you have to setup a server somewhere.
     
    wstelzle likes this.
  6. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    65
    hmm, I think I would rather use native, running servers we already do but I don't want to add more complexity just for voice announcements.
     
  7. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    We're currently developing a MaryTTS-service for our users.
    It's in alpha-stage, but we would like to offer you for your game an account which is free as long until we release the final product in a few months. Until then, we could together analyze the problems of your customers with the wrapper-exe.
    If you're interested, send me a PM or email with your invoice.


    So long,
    Stefan
     
    wstelzle likes this.
  8. HamFar

    HamFar

    Joined:
    Nov 16, 2014
    Posts:
    60
    @Stefan-Laubenberger Hi Stefan, I have purchased the PRO version and have imported everything in a fresh Unity 5.5 project. I dragged in an empty scene the "TextFileSpeaker" prefab first, which then warned me that I also needed to drag in the "RTVoice" prefab! However, there is no public field in the Inspector for assigning a text file to be spoken. Where do I place the text file containing the words I wanna be spoken? Thanks
     
    wstelzle likes this.
  9. wstelzle

    wstelzle

    Joined:
    Jun 11, 2015
    Posts:
    7
    @Stefan-Laubenberger Dear Stefan, We purchased the pro version in order to enable text-to-speech for VR/AR content. Can we not use this when we build/deploy a project to an Android device?
     
    HamFar likes this.
  10. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Hi HamFar

    There should be this array for the text files:
    upload_2017-7-3_10-12-27.png

    Do you see this?


    Cheers
    Stefan
     
    wstelzle and HamFar like this.
  11. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    You can build for Android... Do you get an error?
     
    HamFar and wstelzle like this.
  12. HamFar

    HamFar

    Joined:
    Nov 16, 2014
    Posts:
    60
    @Stefan-Laubenberger

    Thanks for your quick response! I did not have that array option, nor the Mode option. So, I deleted it all and started fresh by importing everything again. Now, I have both the missing options. I tried dragging a text file on it and it works just AWESOME! Thank you

    p.s. The speech happens when you press the Test-Drive button in Editor mode. I am, of course, going through the docs now, but perhaps I can ask this question to save myself some time: How do I trigger this at run-time given that the Test-Drive is disabled in Play mode? Cheers
     
    wstelzle likes this.
  13. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    There are two methods for "TextFileSpeaker" which can be called at run-time:
    • Speak() // random text file
    • SpeakText(int index = -1) // index of the text file

    I hope this helps you further!
     
    wstelzle and HamFar like this.
  14. wstelzle

    wstelzle

    Joined:
    Jun 11, 2015
    Posts:
    7
    @Stefan-Laubenberger Quite a few actually! The first one is Error: [Temp/StagingArea/AndroidManifest-main.xml:12, /Users/ws/Desktop/RTvoice/Temp/StagingArea/android-libraries/RTVoiceAndroidBridge/AndroidManifest.xml:3] Main manifest has <uses-sdk android:minSdkVersion='9'> but library uses minSdkVersion='15' UnityEditor.HostView:OnGUI() but when I open the AndroidManifest.xml it says
    <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="24"/> so it should be OK, and there is no other manifest in the project...
     
    HamFar likes this.
  15. wstelzle

    wstelzle

    Joined:
    Jun 11, 2015
    Posts:
    7
    @Stefan-Laubenberger
    We resolved this through setting → Player Settings > Other Settings > Minimum API Level > Android 4.3 "Ice cream Sandwich (API level 15)"
    Hopefully, this will help others having the same issue!
     
    HamFar likes this.
  16. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Thank you for pointing this out!
    We thought it's clear enough in the documentation, but anyway consider it solved ;)

    The upcoming version 2.8.0 will automatically set the correct API-level in the Android build settings!

    I hope this is fine.


    Cheers
    Stefan
     
    wstelzle and HamFar like this.
  17. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    We also got rid of some legacy code to maintain pre-iOS 8-versions. The target version will now be set to the correct level.
     
    Last edited: Jul 4, 2017
    wstelzle likes this.
  18. wstelzle

    wstelzle

    Joined:
    Jun 11, 2015
    Posts:
    7
    @Stefan-Laubenberger
    This is brilliant Stefan, Many thanks. Just checking if we can freely upgrade (to the upcoming version) now that we have purchased the pro version from the Asset Store?
     
  19. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Sure, updates are free :)
     
    HamFar and wstelzle like this.
  20. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    65
    I might take you up on this but before that I have found out some more info on how to recreate this issue from a customer running the latest code version.
    The customer uses BitDefender AV solution, this antivirus product does not like the wrapper exe and every time a voice announcement is made in my game he gets a two second pause in the whole game. If he white lists the wrapper exe then the problem goes away.

    I'm happy to accept that AV solutions will do what they are going to do but why the whole game freezes when this happens I don't understand, surely there is a way to stop this happening. I tried putting the call to the speaktext in a coroutine and it still freezes the whole thing. I haven't tried speaknative yet.
     
  21. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Hello again

    I have some ideas on improving things... Currently, every speech starts a process, which normally needs no time and doesn't freeze the game (stupid AV snake oil! :mad:).

    So, if we start the process only once during the whole game, there would be no lags. But, it's a lot of work from our side and I can't promise anything right now.
    The other possibility is to sign our exes - that would probably stop the darn AV-solutions. This also needs time and money ;-)


    Cheers
    Stefan
     
  22. simpegame

    simpegame

    Joined:
    May 19, 2017
    Posts:
    1
    TypeLoadException: Could not load type 'UnityEngine.WWWAudioExtensions' from assembly 'RTVoice'.
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    Crosstales.RTVoice.Speaker:SpeakWithUID(Wrapper)
    Crosstales.RTVoice.Speaker:Speak(String, AudioSource, Voice, Boolean, Single, Single, String, Single)
    Crosstales.RTVoice.SALSA.Speak:Talk() (at Assets/crosstales/RTVoice/3rd party/SALSA/Scripts/Speak.cs:55)
    UnityEngine.EventSystems.EventS


    I am unity version 5.3.6, RT - Voice is PRO version 2.7.2
    thinks!
     
  23. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Hi

    You are using the RTV-version for Unity 5.6+.
    Simply follow the upgrade instructions in the asset (-> re-download it from the UAS and install it for Unity 5.3.6).


    Cheers
    Stefan
     
  24. drhmiri

    drhmiri

    Joined:
    Jun 17, 2014
    Posts:
    59
    @Stefan-Laubenberger

    Hi Stefan, I am experimenting with a couple of ways to read out text to an Android device user. Quite promising so far!

    Below, you will see a few lines of code, after I have dragged into my scene the two required prefabs: RTVoice and TextFileSpeaker.

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5.  
    6. namespace Crosstales.RTVoice.Demo
    7. {
    8.     public class Test : MonoBehaviour
    9.     {
    10.         private GameObject _myTextFileSpeakerPrefab;
    11.  
    12.         void Start()
    13.         {
    14.             // Put text in string variable and play it at run-time.
    15.             Speaker.Speak("Hi there! I am the Voice Manager.");
    16.  
    17.             // Find the TextFileSpeaker prefab in the scene.
    18.             _myTextFileSpeakerPrefab = GameObject.Find("TextFileSpeaker");
    19.         }
    20.  
    21.         void OnGUI()
    22.         {
    23.             if (GUI.Button(new Rect(Screen.width/2, Screen.height/2, 200, 50), "Read Out Instructions"))
    24.             {
    25.                 Debug.Log("Instructions Button Pressed");
    26.                 Debug.Log(_myTextFileSpeakerPrefab.name);
    27.  
    28.                 // Read out the instructions.
    29.                 StartCoroutine(Instruct(1f));
    30.             }
    31.         }
    32.  
    33.         IEnumerator Instruct(float delay)
    34.         {
    35.             yield return new WaitForSeconds(delay);
    36.  
    37.             Speaker.Speak("Optical Character Recognition can help you find information on your device quickly. blah blah blah");
    38.         }
    39.     }
    40. }
    41.  
    My first question is: Is there a limit to the length of the text you can squeeze in Speaker.Speak("")?

    My second question is: How do I get the already-in-the-scene TextFileSpeaker prefab to do the reading-job for me, instead of putting all the text in the Speaker.Speak("") of my IEnumerator? With the prefab, I can just drag and drop onto it a text file, but that only works in Editor mode. Is there anyway I can get this prefab to do what I am currently doing by copying&pasting text into the Speaker.Speak("") method? As you can see in the code, I can find the prefab in the Hierarchy and access it, but not sure how I can do the rest with it and then build to device?

    Thanks,

    Q.png
     
  25. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Hello

    I try to answer your questions:
    • Speech text limit: I think it would be the typical 65536 chars limit, but we never tested it with sooo much text. Feel free to try it out and please report back ;)
    • TextFileSpeaker has two methods called Speak() and SpeakText(int index = -1) which can be called by your script instead of passing the text to the Speaker.Speak-call.
    • You can add as many TextFileSpeakers to your scene as you need (e.g. a TFS for every NPC). Then add the desired text files to them. Lastly, you can configure the voice, rate etc. After that, I would create a script with public variables of the different TextFileSpeakers and call one of the methods above when needed.
    I hope this helps you further.


    Cheers
    Stefan
     
    drhmiri and HamFar like this.
  26. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    We proudly present you RT-Voice with WebGL! :)

    Please checkout the demo.


    Cheers
    Stefan
     
    Nateply, drhmiri and TonyLi like this.
  27. Umresh

    Umresh

    Joined:
    Oct 14, 2013
    Posts:
    8
    Hi,
    I'm using version 2.7.1 and using

    Speaker.SpeakNative(text,Speaker.VoicesForCulture( "en-gb" )[0])

    to play for first time when i play it takes some time to speak text.
     
  28. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Hi Umresh

    Please update to the latest version 2.7.4 and try it again ;)


    Cheers
    Stefan
     
  29. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    We ordered a key and can soon sign our exes - I hope this helps... :(
    Send me an email with the invoice and I provide the signed exes asap.


    Cheers
    Stefan
     
  30. Umresh

    Umresh

    Joined:
    Oct 14, 2013
    Posts:
    8
    When i quit app i get

    NullReferenceException: Object reference not set to an instance of an object
    at Crosstales.RTVoice.Provider.VoiceProviderAndroid.Silence ()
    at Crosstales.RTVoice.Speaker.OnApplicationQuit ()
     
  31. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Did you update to the new version and is there this issue?
     
    Last edited: Jul 6, 2017
  32. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    We've just submitted version 2.8.0 of RT-Voice.
    Here are the changes:
    • Demo scenes improved
    • Android: automatically set the correct API-level
    • iOS: legacy code for pre-iOS 8 removed. Now are all voices selectable.
    • iOS: automatically set the correct target SDK
    • iOS: speech rate fixed
    • MaryTTS: HTTP-auth added
    • Callbacks: EventArgs removed and replaced by parameters (like the 'Wrapper' etc.)
    • Speaker: Speak-parameters changed (switched the positions of 'outputFile' and 'pitch')
    • New callback 'OnVoicesReady' added
    • DLL removed (only source code in PRO)
    • EXEs and DLLs are now signed
    • Documentation for MaryTTS-server with HTTPS added (for WebGL)

    Have a nice weekend!


    Cheers
    Stefan
     
    Last edited: Jul 8, 2017
    Feaver1968 likes this.
  33. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Hello again

    The latest version 2.8.0 has signed EXEs.
    If you wanna try it, send me an email with the invoice.


    So long,
    Stefan
     
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    The new version is at the store! :)

    Enjoy!


    Cheers
    Stefan
     
  35. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    The PRO version is now on our Summer Sale and 25% off.
    The upgrade-path from the Standard version is also reduced by 50%!

    Grab it now!


    Enjoy :)
    Stefan
     
    Last edited: Jul 12, 2017
  36. bonisthegreat

    bonisthegreat

    Joined:
    Jul 14, 2017
    Posts:
    1
    Hello @Stefan-Laubenberger ! I just bought RT Voice Pro and cant make it read anything on Unity. Getting the following errors on the console.

    upload_2017-7-14_10-18-11.png

    Which point to:
    VoiceProviderMary.cs 176: AudioClip ac = www.GetAudioClip(false, false, AudioType.WAV);
    VoiceProviderMary.cs 181: while (ac.loadState == AudioDataLoadState.Loading);
    VoiceProviderMary.cs 186: if (wrapper.Source != null && ac.loadState == AudioDataLoadState.Loaded)

    Any ideas?
     
    Last edited: Jul 14, 2017
  37. pedro-meleiro

    pedro-meleiro

    Joined:
    Nov 6, 2013
    Posts:
    7
    I'm having some trouble using the voices I have installed in my Windows 10 machine. I followed the instructions posted here, and yet the only voice that's being recognized by RT-Voice is Microsoft Zira Desktop, which I wasn't aware I had installed. I was expecting to at least be able to use Microsoft Helia Mobile, since that one is selected under Settings > Time & Language > Speech in the Settings menu (and is able to read text).

    Meanwhile, I found out about the Control Panel > Speech Properties > Text to Speech menu, which only lists Microsoft Zira Desktop, despite the fact that I have other voices installed and featured in the Settings > Time & Language > Region & Language menu.

    This is a bit puzzling and has probably nothing to do with RT-Voice, but are you aware of what might be causing this? Is there any way to programmatically get these voices? I don't quite understand why Microsoft keeps two different menus for what seems to be the exact same thing (text to speech, they're even called the same).
     
    Last edited: Jul 14, 2017
  38. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    I wrote you an email.

    So long,
    Stefan
     
  39. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Hi Pedro

    I'm not sure what's causing this, which Windows 10-version are you using, 32- or 64bit?

    To install voices, please follow the instructions in chapter 6.1 of the documentation:
    https://www.crosstales.com/media/data/assets/rtvoice/RTVoice-doc.pdf


    Cheers
    Stefan
     
    pedro-meleiro likes this.
  40. pedro-meleiro

    pedro-meleiro

    Joined:
    Nov 6, 2013
    Posts:
    7
    Thanks @Stefan-Laubenberger, the instructions in the document worked just fine, I'm now able to use other voices on Windows 10.

    It still beats me why I would need to edit the registry files myself and why voices installed using the Settings menu do not work.
     
  41. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    I think the instructions you tried first were for the Windows 10-UWP-part, so they were only for Windows-apps and not for "normal" Windows-applications.
    If you own the PRO-version, you can build for the Windows Store and try it out ;)

    Have a nice weekend!


    Cheers
    Stefan
     
    pedro-meleiro likes this.
  42. rocki

    rocki

    Joined:
    Aug 10, 2012
    Posts:
    1,272
    Just bought RTvoice Pro and it's looking great.
    Only thing is that I have a mac and the TextFile Speaker Demo is not working.

    Error:
    Could not generate the speech: 400 Bad Request
    UnityEngine.Debug:LogError(Object)
    Crosstales.RTVoice.Provider.<speak>c__Iterator2:MoveNext() (at Assets/crosstales/RTVoice/Plugins/Scripts/Provider/VoiceProviderMary.cs:228)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
  43. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Hi rocki

    Thank you for buying RTV!

    First of all, you're using MaryTTS... This is your intention, right?
    Secondly, we have a small bug with MaryTTS: you have to add a voice for the Speak-call, like this:
    Code (CSharp):
    1. Speaker.Speak ("Hi rocki, how are you?", null, Speaker.VoiceForCulture("en"));
    It's already fixed, if you send me an email with the invoice, I can give you the new version.
    But anyway, it's always a good idea to specify the voice :)


    Cheers
    Stefan
     
  44. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Ok, it was something else :mad:
    We let our TextFileSpeaker read our "README.txt" which was too long for MaryTTS...
    Here is another text file which works, just add it to your project replace it in the demo scene:

    upload_2017-7-17_12-19-58.png

    You could also add a voice for MaryTTS.


    Cheers
    Stefan
     

    Attached Files:

    • Poem.txt
      File size:
      723 bytes
      Views:
      6
    Last edited: Jul 17, 2017
  45. rocki

    rocki

    Joined:
    Aug 10, 2012
    Posts:
    1,272
    Great it's working now.

    Btw, I thought that if I'm in the editor on my mac it would use my mac's voice instead of MaryTTS.
     
  46. rocki

    rocki

    Joined:
    Aug 10, 2012
    Posts:
    1,272
    On Demo 2, I'm getting this error:
    Edit, Other demos are getting the same error when I uncheck the MaryTTS default voice.

    Could not read the file: Unknown Error
    UnityEngine.Debug:LogError(Object)
    Crosstales.RTVoice.Provider.<Speak>c__Iterator1:MoveNext() (at Assets/crosstales/RTVoice/Plugins/Scripts/Provider/VoiceProviderMacOS.cs:311)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
     
  47. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    What is your current build target?

    Edit:
    I tried it with our Mac and I couldn't simulate the issue you described... Can you please provide me with more information how you "did this"?
     
    Last edited: Jul 17, 2017
  48. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Awesome news:
    The next release will add SSML- (prosody) and EmotionML-support for MaryTTS! :cool:
    We hope that we can add SSML also for Windows, but we can't promise that right now...


    Cheers
    Stefan
     
  49. mikejohnstn

    mikejohnstn

    Joined:
    Dec 9, 2016
    Posts:
    3
    We're seeing the same error on Mac (OSX 10.12.5) with Unity 2017, triggered with this line:

    using (WWW www = new WWW("file:///" + outputFile))
    I checked and the file in outputFile definitely exists in the file system, so the generation seems to have worked, and something is preventing WWW from accessing the created file.
     
  50. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    456
    Could you please try something? What happens if you change the line (remove one slash):

    using (WWW www = new WWW("file://" + outputFile))

    Thx!


    Cheers
    Stefan