Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. Unity 2017.3 has arrived! Read about it here.
    Dismiss Notice
  3. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

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

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

  1. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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.
  2. HamFar

    HamFar

    Joined:
    Nov 16, 2014
    Posts:
    66
    @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.
  3. 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.
  4. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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.
  5. Stefan-Laubenberger

    Stefan-Laubenberger

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

    HamFar

    Joined:
    Nov 16, 2014
    Posts:
    66
    @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.
  7. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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.
  8. 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.
  9. 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.
  10. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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.
  11. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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.
  12. 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?
     
  13. Stefan-Laubenberger

    Stefan-Laubenberger

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

    catfink

    Joined:
    May 23, 2015
    Posts:
    85
    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.
     
  15. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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
     
  18. drhmiri

    drhmiri

    Joined:
    Jun 17, 2014
    Posts:
    71
    @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
     
  19. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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.
  20. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Please checkout the demo.


    Cheers
    Stefan
     
  21. 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.
     
  22. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    Hi Umresh

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


    Cheers
    Stefan
     
  23. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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
     
  24. 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 ()
     
  25. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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
     
  27. 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
  28. pedro-meleiro

    pedro-meleiro

    Joined:
    Nov 6, 2013
    Posts:
    8
    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
  29. Stefan-Laubenberger

    Stefan-Laubenberger

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

    So long,
    Stefan
     
  30. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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.
  31. pedro-meleiro

    pedro-meleiro

    Joined:
    Nov 6, 2013
    Posts:
    8
    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.
     
  32. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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.
  33. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,297
    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)
     
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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
     
  35. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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:
      12
    Last edited: Jul 17, 2017
  36. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,297
    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.
     
  37. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,297
    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)
     
  38. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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
  39. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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
     
  40. mikejohnstn

    mikejohnstn

    Joined:
    Dec 9, 2016
    Posts:
    8
    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.
     
  41. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    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
     
  42. mikejohnstn

    mikejohnstn

    Joined:
    Dec 9, 2016
    Posts:
    8
    Confirmed, that works. Thanks.
     
  43. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    Thank you, we will fix this in the next release!
     
  44. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    Yeah, it's getting even better: SSML works now also in Windows!

    Another upcoming feature: define all speeches in a text file (incl. voice, rate, pitch and volume) and generate them as audio files!

    Happy times! :)


    Cheerio
    Stefan
     
  45. lscroberto

    lscroberto

    Joined:
    Mar 28, 2017
    Posts:
    9
    hi
    i am developing a project in unity using RT-Voice but the voices of the dispositives do not, we like.
    They have not thought about adding more real and personalized voices.
    thanks for your atention.
     
  46. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    Hi

    The voices in RTV aren't part of our package - we use the underlying TTS system (or MaryTTS).
    But you can add your own voices like described in chapter 6 of the documentation:

    https://crosstales.com/media/data/assets/rtvoice/RTVoice-doc.pdf


    Or use MaryTTS; there it's even possible to create your own voice as you like it:

    https://github.com/marytts/marytts/wiki/HMMVoiceCreation


    Cheers
    Stefan
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    7,428
    Dialogue System users: The Dialogue System Extras page has an updated support package for RT-Voice 2.8.1.
     
    Stefan-Laubenberger likes this.
  48. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    714
    Thank you Tony for your awesome support!
     
  49. ZBAnimations

    ZBAnimations

    Joined:
    Jul 27, 2017
    Posts:
    1
    Hello! I was interested in purchasing RTVoice, but had two questions:

    1) Could this service be used with a chatbot service like Api.ai? I've been seeing people integrate Alice into this and was curious.

    2) What is the difference between getting the Pro version and just purchasing the regular RTVoice (besides the source code, and what would it mean using that)?

    Thanks!

    - S.R.
     
  50. lscroberto

    lscroberto

    Joined:
    Mar 28, 2017
    Posts:
    9
    Thanks for your reply.
    I would be interested in using some voices from third parties such as ivona
    But I do not see in the manual how to implement it, they could help me.
    Thank you very much