Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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:
    1,959
    How about this script?

    Code (CSharp):
    1. using UnityEngine;
    2. using Crosstales.RTVoice;
    3.  
    4. public class SequentialSpeak : MonoBehaviour
    5. {
    6.     public string[] Speeches;
    7.  
    8.     private int index = -1;
    9.     private string uid;
    10.  
    11.     public void Start()
    12.     {
    13.         Speaker.OnSpeakComplete += onSpeakComplete;
    14.  
    15.         Speak();
    16.     }
    17.  
    18.     public void OnDestroy()
    19.     {
    20.         Speaker.OnSpeakComplete -= onSpeakComplete;
    21.     }
    22.  
    23.     public void Speak()
    24.     {
    25.         index++;
    26.  
    27.         if (Speeches != null && index < Speeches.Length)
    28.         {
    29.             uid = Speaker.Speak(Speeches[index]);
    30.         }
    31.         else
    32.         {
    33.             Stop();
    34.         }
    35.     }
    36.  
    37.     public void Stop()
    38.     {
    39.         index = -1;
    40.     }
    41.  
    42.     private void onSpeakComplete(Crosstales.RTVoice.Model.Wrapper wrapper)
    43.     {
    44.         if (wrapper.Uid.Equals(uid) && index >= 0)
    45.         {
    46.             Debug.Log("onSpeakComplete: " + wrapper);
    47.  
    48.             Speak();
    49.         }
    50.     }
    51. }
    Line 15 is optional and can be replaced e.g. by a button-event.

    Please let me know if this is what you are looking for.
     
    faddou likes this.
  2. faddou

    faddou

    Joined:
    Aug 3, 2016
    Posts:
    8
    Ok, I started to look at the Sequencer example but this solution looks more suited to my program.

    Thanks
     
    Stefan-Laubenberger likes this.
  3. SierraChica

    SierraChica

    Joined:
    Aug 5, 2014
    Posts:
    8
    Hi Stefan,

    I have purchased the PRO version to be able to target to UWP but I'm having problems with the build.

    I have created just a project with RT-Voice (in Unity 5.6.3p3) and try to build for UWP with Scripting Backend = IL2CPP and I get the next error:
    Assets\crosstales\RTVoice\Plugins\Scripts\Provider\VoiceProviderWSA.cs(104,32): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

    It works with Scripting Backend = .NET but I would need IL2CPP for my full project. Am I missing anything in the configuration?

    Regards,
    Juan
     
  4. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    Hi Juan

    I've just verified it with Unity 2017.2 and it builds without any problems for WSA (IL2CPP).
    Is there a chance you could try it with 2017.2?


    Cheers
    Stefan
     
  5. SierraChica

    SierraChica

    Joined:
    Aug 5, 2014
    Posts:
    8
    Thanks Stefan... downloading latest Unity version.

    Cheers,
    Juan
     
  6. SierraChica

    SierraChica

    Joined:
    Aug 5, 2014
    Posts:
    8
    Same error with Unity 2017.2 using:
    - Scripting Runtime version: Stable (.NET 3.2 Equivalent)
    - Scripting Backend: IL2CPP
    - Api compatibility level: .NET 2.0 Subnet

    What configuration do you use?

    Cheers,
    Juan
     
  7. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    This is my configuration:
    Capture.PNG


    I'm using VS 2015.

    Which Unity and asset version are you using?
     
  8. diegosdias

    diegosdias

    Joined:
    Jul 26, 2016
    Posts:
    12
    Was the asset path configuration removed from “Tools\RTVoice\Configuration...”: on the 2.9.0 version? (I can't find it)
    How are we supposed to change the path now, change directly on the code?
     
  9. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    No, you just can move the whole asset where ever you want.
    Just make sure you don't delete the "Documentation" folder :)
     
    SierraChica likes this.
  10. diegosdias

    diegosdias

    Joined:
    Jul 26, 2016
    Posts:
    12
    If it is directly on the Assets folder, it works.
    However if I put it on Assets/Vendor , I am getting the error

    Could not find the TTS-wrapper: '.../Assets/crosstales/RTVoice/Plugins/Windows/RTVoiceTTSWrapper.exe'

    (which for me means that the path is not being changed when I change the files path)
    Am I doing anything wrong?
     
  11. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    Yes, you're right - I made a silly error... :mad:
    Please send me your invoice via email and I can give you an update asap.


    Cheers
    Stefan
     
  12. SierraChica

    SierraChica

    Joined:
    Aug 5, 2014
    Posts:
    8
    Thank you!! Finally is working :)
     
    Stefan-Laubenberger likes this.
  13. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    247
    what is the difference between pro and lite version?
     
  14. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Thank you for your interest in RT-Voice!

    For PRO you get:
    • Full C# source code
    • Support for WSA (UWP)
    • Beta versions and fixes (standard is bound to our official releases)
    We don't offer refunds for the PRO version. If you are unsure, buy the standard version and test it.

    I hope this helps you further.


    Cheers
    Stefan
     
  15. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    After the recent update, I`ve found that you removed preference for custom location of RTVoice, how can I workaround that? I need to have it like Crosstales.RTVoice.Util.Config.ASSET_PATH = "/MyFramework/Third Party/RTVoice/";
    Also seems for windows (in standard mode) it gives me an error (unity 2017.3b9) In native mode works well.

    TypeLoadException: Could not resolve type with token 01000079 (from typeref, class/assembly UnityEngine.WWWAudioExtensions, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    Crosstales.RTVoice.Speaker:SpeakWithUID(Wrapper)
    Crosstales.RTVoice.Speaker:Speak(String, AudioSource, Voice, Boolean, Single, Single, Single, String)
     
    Last edited: Dec 3, 2017
  16. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Yes, we now automatically locate RT-Voice - you can put it anywhere :)

    About the error: I blame Unity :p
    No seriously, Unity moved the WWW-class method "GetAudioClip" to the class WWWAudioExtensions in 5.6. Now it's removed an put again into the WWW-class in 2017.3... Since it's only beta, I'm unsure what they really plan. As you can imagine, this is for us also not cool...
    However, just send me an email with you invoice and I send you a version for 2017.3.


    Cheers
    Stefan
     
  17. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    done ;)
     
  18. Pemdora

    Pemdora

    Joined:
    Oct 18, 2017
    Posts:
    7
    Hello, I need to generate audio speeches in French but the voice does not recognize french accent (à,é,ê,ô....) though it works well in Word when I play "reading aloud function".
     
  19. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Which RT-Voice version, OS and voice are you using?
     
  20. Pemdora

    Pemdora

    Joined:
    Oct 18, 2017
    Posts:
    7
    I'm using RT-Voice PRO 2.9.1 with Windows 10 and for the voice I use Microsoft Hortense, although the audio asset does not recognizes french accent in txt file, it recognizes well french pronounciation on other words.
     
  21. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    Hmm, I'm a bit confused... Does RT-Voice work for you with the normal "Speak" method and French accents?
    But it dosen't work with text files? How do you "feed" the text files to RTV?
     
  22. Pemdora

    Pemdora

    Joined:
    Oct 18, 2017
    Posts:
    7
    Yes, French accents works with normal "Speak" method but not with "AudioFileGenerator" maybe because when it reads the text file, it doesn't read accent (é,è,à...) is there a way to change text file encoding in the source code ?
    To "feed" the text files to RTV, I just put all my sentences in a Speeches.txt file and it generates well all the audio files (.wav).

    upload_2017-12-19_0-36-33.png
     
  23. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    We use the normal Unity TextAsset class and I think the problem is the encoding of the text file. It has to be UTF8.
     
  24. Pemdora

    Pemdora

    Joined:
    Oct 18, 2017
    Posts:
    7
    Ok thank you, I managed to change encoding to UTF-8. with Notepad++ and it works fine.
     
    Stefan-Laubenberger likes this.
  25. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    Lipsync Pro is saying [AutoSync] ERROR: Input audio file has sample rate [22050], but decoder expects [16000]

    How do I generate 16000 sample rate files? I have been using your AudioFileGenerator scene and are new to your asset.
     
  26. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    Hi Ryan

    I improved the "AudioFileGenerator". Now you can set the desired sample rate, bits and channels:
    Capture.PNG

    But this will only work under Windows stand-alone.
    If you like to have the new fix, please send me your invoice via email.

    So long,
    Stefan
     
  27. Pemdora

    Pemdora

    Joined:
    Oct 18, 2017
    Posts:
    7
    You have to enable Sox in LipSyncpro so that AutoSync can read 22050 samples rates. (You will have a sound better quality)
    [Read doc Using SoX with AutoSync.pdf in LipSyncPro package]
     
  28. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    Good to hear :)
    But I'm happy that our tool now can do this too.
     
  29. developerEbibelot

    developerEbibelot

    Joined:
    Oct 16, 2017
    Posts:
    10
    Hi,
    I'm getting import error from RTvoice version 2.9.2 and Unity 2017.3.0.f3. I think there are some constants missing in Util files. Can you check the error please? Screen Shot 2017-12-20 at 19.16.47.png
     
  30. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
  31. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    305
    Hello, just bought the plugin this morning but I'm having a build problem here:
    ArgumentException: The Assembly UnityEditor is referenced by RTVoice ('Assets/Plugins/crosstales/RTVoice/RTVoice.dll'). But the dll is not allowed to be included or could not be found.
    Using Unity 5.6.2p1 on OSX 10.12.6, building for Windows X86. The DLL file is indeed in the specified folder.
     
  32. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Yes, you're right! I made a mistake on my side, but it's already fixed.
    Please send me an email with your invoice and I can send you the new DLL.


    So long,
    Stefan
     
  33. rgonsalv

    rgonsalv

    Joined:
    Sep 29, 2016
    Posts:
    47
    Our Unity Cloud Builds are usually failing now with a 2.7.x version of the plugin with this error:
    Code (CSharp):
    1. Unity] Could not load update file:
    2.  
    3. 393: [Unity]   at System.Net.WebClient.DownloadDataCore (System.Uri address, System.Object userToken) [0x00000] in <filename unknown>:0
    4. 394: [Unity]   at System.Net.WebClient.DownloadData (System.Uri address) [0x00000] in <filename unknown>:0
    5. 395: [Unity]   at System.Net.WebClient.DownloadString (System.String address) [0x00000] in <filename unknown>:0
    6. 396: [Unity]   at (wrapper remoting-invoke-with-check) System.Net.WebClient:DownloadString (string)
    7. 397: [Unity]   at Crosstales.RTVoice.EditorExt.UpdateCheck.readData () [0x00033] in /BUILD_PATH/lingraphica.multitalk.windows-master/Assets/crosstales/RTVoice/Plugins/Editor/UpdateCheck.cs:249
    8. 398: [Unity] UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    9. 399: [Unity] UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    10. 400: [Unity] UnityEngine.Logger:Log(LogType, Object)
    11. 401: [Unity] UnityEngine.Debug:LogError(Object)
    12. 402: [Unity] Crosstales.RTVoice.EditorExt.UpdateCheck:readData() (at Assets/crosstales/RTVoice/Plugins/Editor/UpdateCheck.cs:271)
    13. 403: [Unity] Crosstales.RTVoice.EditorExt.UpdateCheck:updateCheck() (at Assets/crosstales/RTVoice/Plugins/Editor/UpdateCheck.cs:114)
    14. 404: [Unity] Crosstales.RTVoice.EditorExt.UpdateCheck:<UpdateCheck>m__0() (at Assets/crosstales/RTVoice/Plugins/Editor/UpdateCheck.cs:50)
    15. 405: [Unity] (Filename: Assets/crosstales/RTVoice/Plugins/Editor/UpdateCheck.cs Line: 271
    We thought deleting the .cs files under crosstales/RTVoice/plugins/Editor (except for the Windows post-build processor) would solve this as a hack but the problem persists.
     
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    Thats strange... Files in "Editor" folders should be ignored anyway :(
    What problems do you see after deleting "UpdateCheck.cs"?

    If possible, please consider upgrading to 2.9.3 since the 2.7.x line is very old...
     
    Last edited: Jan 2, 2018
  35. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    does it support web version perfectly?.chrome and safari browsers
     
    Last edited: Jan 3, 2018
  36. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    Yes, except the platfom limits like no FFT.

    You can test it here:
    WebGL
     
  37. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    Hello .just now purchased rt voice standard edition from asset store today.
    i tried to build using the plugin i got the following error.Please find out below


    ArgumentException: The Assembly UnityEditor is referenced by RTVoice ('Assets/Plugins/crosstales/RTVoice/RTVoice.dll'). But the dll is not allowed to be included or could not be found.
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:152)
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:158)
    UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:192)
    UnityEngine.GUIUtility crocessEvent(Int32, IntPtr)
     
    Last edited: Jan 3, 2018
  38. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    I made a mistake in the last release, but a fix is ready.
    Please send me your invoice.

    Thank you!
     
  39. rgonsalv

    rgonsalv

    Joined:
    Sep 29, 2016
    Posts:
    47
    I now think this was a transient internet error (though it did happen over several days). Our last 7 cloud builds have been problem free.
     
    Stefan-Laubenberger likes this.
  40. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    invoice is sent to your mail id sir.please check it out sir asap!
     
  41. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    I answered your email and sent you the fix.
    I hope everything is fine now :)
     
  42. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    p
    perfect man u rocks now building fine.very very fast support
     
    Stefan-Laubenberger likes this.
  43. pep_dj

    pep_dj

    Joined:
    Nov 7, 2014
    Posts:
    178
    Hi. Can I use your plugin to generate wav files at runtime? I would like to let the user write something, then generate a wav file that the user can modify and share.
     
  44. Stefan-Laubenberger

    Stefan-Laubenberger

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

    Yes you can :)
    Just add the output-file to the "Speak"-call. For more, see:
    https://www.crosstales.com/media/da...ass_crosstales_1_1_r_t_voice_1_1_speaker.html

    The only exception is iOS: Apple doesn't allow the audio file generation of speeches with their native engine. But you can use MaryTTS under iOS, which is fully supported in RTV.


    Cheers
    Stefan
     
    pep_dj likes this.
  45. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    hello stefan .i got one more new problem.i successfully tested in standalone build its working fine.if i build for webgl the voice is not working . ? why the same file is not working for webgl!.
     
  46. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    Did you add your own MaryTTS server?
     
  47. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    own marry tts server? what is that mean?
     
  48. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    i want to do the step which u mentioned in pdf?
     
  49. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    Assets/crosstales/RTVoice/Documentation/MaryTTS.pdf
    this one u mean?
     
  50. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,959
    Yes, WebGL has no native voices, so we have to use a service to generate the audio.
    But you can use our server for testing purposes if you don't wanna do the work right now.
    Just send us an email with your invoice.