Search Unity

EasyTTS 2.0 (Text-to-Speech) - a native text-to-speech for iOS and Android

Discussion in 'Assets and Asset Store' started by FreCre, Jan 30, 2015.

  1. FreCre

    FreCre

    Joined:
    Nov 27, 2014
    Posts:
    3
    EasyTTS 2.0 is a plugin that allows you to easily use the native text-to-speech feature of iOS and Android.
    Direct link to Asset Store
    Untitled-1.png
    System Requirements:
    iOS7 or higher
    Adroid 1.6 or higher
    In Android, TTS Engine must be installed


    ① Import the package, EasyTTS.unitypackage
    ② Need to put this files on your project:

       Plugins / Android / EasyTTSUtil.jar
       Plugins / iOS / EasyTTSUtil.mm
       Plugins / iOS / EasyTTSUtil.h
    Note:
     Plugin(folder): Please make sure that is included in your project.​
    It is used to bundle all components and resources into a single file to distribute application software or libraries.​

    Detailed Description
    EasyTTSUtil.Speech (a string that converts into speech) - in which perform a text-to-speech
    EasyTTSUtil.Initialize() - Initializing the text to speech
    EasyTTSUtil.Stop() - to end the process

    This are needed so that text-tospeech will perform.

    Sample code on how to use EasyTTS for iOS and Android
    ex.
    Code (CSharp):
    1. public class DemoEasyTTS : MonoBehaviour {
    2.  
    3.     private string stringToEdit = "Test";
    4.  
    5.     void OnGUI ()
    6.     {
    7.         stringToEdit = GUI.TextField (new Rect (Screen.width/2-100, Screen.height/2-100, 200, 50), stringToEdit,200);
    8.         if (GUI.Button (new Rect (Screen.width/2-50, Screen.height/2-20, 100, 40), "Speak")) {
    9.  
    10.             EasyTTSUtil.SpeechAdd(stringToEdit);
    11.         }
    12.     }
    13.  
    14.     void Start(){
    15.         EasyTTSUtil.Initialize (EasyTTSUtil.UnitedStates);
    16.     }
    17.    
    18.     void OnApplicationQuit()
    19.     {
    20.         EasyTTSUtil.Stop ();
    21.     }
    22. }
    Additional feature for Android only :
    In android, user can switch other TTS engine to change option of Voice Setting and Language for the inputed text.There's a case that changing Voice Setting and Language will depend on the installed TTS engine.

    EasyTTSUtil.Initialize(language, engine);
    language - use the ISO 639-1 language code.
    engine - is the package name of the installed TTS engine.​

    EasyTTSUtil.GetEnginePkgArray() - in this method, you can get the list of TTS names that are installed in device.​

    In addition, a method that opens a screen for voice setting of the device:
    EasyTTSUtil.OpenTTSSetting() - this can also be used, please use if tis needed.​

    Sample code of Addtional Feature for Android :
    ex.

    Code (CSharp):
    1. public class DemoEasyTTS_SelectEngine : MonoBehaviour
    2. {
    3.  
    4.     private string stringToEdit = "Test";
    5.     private bool selecting = false;
    6.     private string engineName = "";
    7.     private string enginePkg ="";
    8.  
    9.     void OnGUI ()
    10.     {
    11.         stringToEdit = GUI.TextField (new Rect (Screen.width / 2 - 100, Screen.height / 2 - 100, 200, 50),
    12.           stringToEdit, 200);
    13.         if (GUI.Button (new Rect (Screen.width / 2 - 50, Screen.height / 2 - 20, 100, 40), "Speak")) {
    14.             EasyTTSUtil.SpeechAdd (stringToEdit);
    15.         }
    16.         if (GUI.Button (new Rect (Screen.width / 2 - 50, Screen.height / 2 +100, 100, 40), "SelectList")) {
    17.             selecting = true;
    18.         }
    19.         if (GUI.Button (new Rect (Screen.width / 2 - 50, Screen.height / 2 +300, 100, 40), "OpenTTSSetting")) {
    20.             EasyTTSUtil.OpenTTSSetting ();
    21.         }
    22.  
    23.         if (selecting) {
    24.  
    25.             string[] nameArray = EasyTTSUtil.GetEngineNameArray ();
    26.  
    27.             int selected = -1;
    28.             selected = GUILayout.SelectionGrid (selected, nameArray, 1);
    29.             if (selected != -1) {
    30.  
    31.                 string[] pkgArray = EasyTTSUtil.GetEnginePkgArray ();
    32.                 enginePkg = pkgArray [selected];
    33.                 engineName = nameArray [selected];
    34.                 EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates,enginePkg);
    35.                 selecting = false;
    36.             }
    37.         }
    38.         if (engineName == null) {
    39.             engineName = "null";
    40.         }
    41.         GUI.TextField (new Rect (Screen.width / 2 - 50, Screen.height / 2 + 200, 100, 40), engineName);
    42.  
    43.     void Start(){
    44.         EasyTTSUtil.Initialize (EasyTTSUtil.UnitedStates);
    45.         engineName = EasyTTSUtil.GetDefaultEngineName ();
    46.     }
    47.  
    48.     void OnApplicationQuit ()
    49.     {
    50.         EasyTTSUtil.Stop ();
    51.     }
    52. }
    53.  

    In EasyTTS packages, Demo Scenes has been provided to demonstrate the inputed text-to-speech.
    DemoEasyTTS.unitypackage is for iOS and Android
    DemoEasyTTS_SelectEngine.unitypackage is for addtional feature for Android only.
    If there's a bug please let us know, we will correspond within the range that can be done so we can improve in the future updates.







     
    Last edited: Feb 1, 2015
  2. SnoozePouch

    SnoozePouch

    Joined:
    Jul 15, 2012
    Posts:
    2
    Hi FreCre,


    I have been looking at releasing a game with speech on Android/iOS, and it's great to see someone wrapping the native capabilities. Can you please explain what the steps are to deploy a game with your asset. E.g. does the user need to install any libraries before they can play? Does speech playback pause the game? stop it? take it to a native screen etc.?

    Thanks
     
  3. gfxguru

    gfxguru

    Joined:
    Jun 5, 2010
    Posts:
    107
    Hi FreCre,

    Thanks for the nice plugin.
    Is there a way to get female voices on ios and android ?
     
    mark_unity775 likes this.
  4. sunstar3d

    sunstar3d

    Joined:
    Dec 6, 2012
    Posts:
    1
    Is there anyway to control the volume of the voice?
     
  5. ctknoxville

    ctknoxville

    Joined:
    Oct 1, 2013
    Posts:
    32
    Wondering the same thing as the others. Is there a way to change the voice and volume of the voice? Thanks.
     
  6. Fistinator

    Fistinator

    Joined:
    Nov 23, 2015
    Posts:
    1
    I just update unity to 5.2.3 and now the voice speaks really slowly. This used to work great on 5.1 but now it sounds terrible. Is there anyway to change the speed that it speaks?
    I tried changing the siri speed settings on the iPhone/ipad but that didn't have any affect.
    Thanks
     
  7. munshi807

    munshi807

    Joined:
    Feb 25, 2014
    Posts:
    4
    Hi ,

    Can i use this commercially for my app ? and is this plugin use Internet for its working ?

    thank you
     
  8. chandan565

    chandan565

    Joined:
    Jul 2, 2015
    Posts:
    1
    I just Updated my xcode to 7.2 and now the voice speaks really slowly. This used to work great on Xcode 6.3 but now it sounds terrible. Is there anyway to change the speed that it speaks?
     
    Last edited: Feb 29, 2016
  9. domdev

    domdev

    Joined:
    Feb 2, 2015
    Posts:
    375
    is there a way I can check if the audio stops?
     
  10. Krlos92

    Krlos92

    Joined:
    Jun 13, 2015
    Posts:
    1
    Hi,

    I have been using your asset for a while, its very nice , but i want to know if is it possible to get a phonetic pronunciation of the letters instead of the name.

    Thank you
     
  11. saviemedia

    saviemedia

    Joined:
    Nov 8, 2016
    Posts:
    7
    You need to open Assets/Plugins/iOS/EasyTTSUtil.mm and increase the utterance.rate value. I put it to 0.4f.
     
    Last edited: Nov 21, 2016
  12. Sujil-V-S

    Sujil-V-S

    Joined:
    Dec 3, 2015
    Posts:
    2
    Hello All,

    Am getting an error in Xcode build

    d: warning: arm64 function not 4-byte aligned: ltmp0 from /Volumes/WORKSPACE/Projects/VirtualLab/Builds/Presenter/iOs/Xcode/Test1/Libraries/libiPhone-lib.a(PLCrashAsyncThread_current-5565F35D16E4818B.o)

    ld: warning: arm64 function not 4-byte aligned: _Unityplcrash_async_thread_state_current from /Volumes/WORKSPACE/Projects/VirtualLab/Builds/Presenter/iOs/Xcode/Test1/Libraries/libiPhone-lib.a(PLCrashAsyncThread_current-5565F35D16E4818B.o)

    Undefined symbols for architecture arm64:

    "_EasyTTSUtilSpeechAd", referenced from:

    _EasyTTSUtil_EasyTTSUtilSpeechAd_m2749186143 in Bulk_Assembly-CSharp_0.o

    (maybe you meant: _EasyTTSUtil_EasyTTSUtilSpeechAd_m2749186143)

    ld: symbol(s) not found for architecture arm64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Am using
    - Unity 5.3.5
    - Xcode 7.3.

    PFA, Screenshot of the Unity Settings
    Please help me to sort this issue out
     

    Attached Files:

  13. mikrima

    mikrima

    Joined:
    Dec 20, 2013
    Posts:
    66
    kelvynornettesol likes this.
  14. kelvynornettesol

    kelvynornettesol

    Joined:
    Nov 16, 2017
    Posts:
    1
    Is the plugin working on iOS 11?
     
    IgorSpartans likes this.
  15. IgorSpartans

    IgorSpartans

    Joined:
    Feb 2, 2018
    Posts:
    1
    Plugin does not work. Unity 2017.1 iOS 11.4 and publisher URL is broken.
    Can anybody help me?
     
  16. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    142
    is it possible to save the speech as an audio file during gameplay?
     
  17. josenunes

    josenunes

    Joined:
    Jun 16, 2017
    Posts:
    9
    Hey there,

    This tool seems great. I am thinking about getting it, but I have a few questions:
    > Does it work offline?
    > Which languages can be chosen?

    Thanks!
     
  18. a-tauzzi

    a-tauzzi

    Joined:
    Dec 20, 2015
    Posts:
    33
    Is it possible to wait for the speech to end? Is there an API to check if the speech has ended?
     
    maheshwarirohit14 likes this.
  19. lorraptus

    lorraptus

    Joined:
    Nov 28, 2017
    Posts:
    1
    I've been using this plugin for some time and it has always worked well. However, today I discovered it has stopped working on iOS - apps which are already live on the App Store and have always worked correctly, now don't speak when supposed to even though we haven't updated them or changed anything. I've tested on both iOS 13 and 14 and there is no speech on either now. I have tested some apps by other developers that use text to speech with the same voices as far as I can tell (presumably using AVSpeechSynthesizer coded natively rather than via this plugin) and they all still work fine. Is this a known issue anybody else has seen?
     
  20. typingbacon

    typingbacon

    Joined:
    Jul 5, 2020
    Posts:
    1
    I'm using this on Unity 2020.01 and I can't seem to make it work
     
    hhassan1230 likes this.
  21. hhassan1230

    hhassan1230

    Joined:
    Jan 9, 2016
    Posts:
    5
    Same here I am using 2019 LTS
     
  22. a-tauzzi

    a-tauzzi

    Joined:
    Dec 20, 2015
    Posts:
    33
    Any plan to make it work with 2020.1 ? If not, please write it on the product description in order people don't buy it anymore
     
  23. cceng2019

    cceng2019

    Joined:
    Oct 3, 2019
    Posts:
    1
    Does it work on Quest2?
     
    specularpro likes this.
  24. sethi-sahil27

    sethi-sahil27

    Joined:
    Apr 8, 2016
    Posts:
    12
    Is it working with Unity 2020.3.6f1 and on Android 11?