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

Native TTS (text to speech) engine plugin for Unity Android

Discussion in 'Android' started by FiveFingers, Oct 31, 2011.

  1. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    Litobyte Softworks is proud to announce:

    Native TTS (text to speech) engine plugin for Unity Android
    http://u3d.as/content/litobyte-softworks/native-tts-engine-plugin/2qU

    Works with both Unity Android Basic and Pro.

    Bring with ease native Android text to speech support right into your unity application.

    You will initialize like this (c#)
    Code (csharp):
    1.         // Startup TTS engine
    2.         ttsengine = new TTSBridge();
    3.         ttsengine.Init();
    And you will use it simply like this:
    Code (csharp):
    1. ttsengine.speak("hello dude!");
    The good thing of native TTS is that doesn't require an active internet connection, is all built-in !

    The plugin doesn't need any additional manifest file to work, this means, there is no unity activity extension subclassing, but a real external jar bridge plug-in that access all android.speech.tts framework features, and it will compile straight away even with other complex android projects setup (eg with other plug-ins which extend unity activities or complex plugins like eg: openfeint)

    All TTS engine important functions are mapped: setting pitch rate and speed as well as changing language when multiple are installed.

    Here a short video demonstrating the plugin:
     
    Last edited: Nov 21, 2011
  2. Dan Fury

    Dan Fury

    Joined:
    Jul 18, 2010
    Posts:
    158
    Will this be free?
    I wrote a TTS heavy application without Unity, because it seemed like a hassle to use TTS in Unity, but if this is free I'll think about porting it over sometime in the future for nice 3D Menues with Scaleform.
     
  3. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    I'm afraid It won't be free, but as low as 25$
    I guess anybody in need of system TTS in the App will find it useful and very cheap, in comparison to coding the plugin their self
     
  4. lbalasubbaiahapps

    lbalasubbaiahapps

    Joined:
    Oct 6, 2011
    Posts:
    23
    hi Litobyte friends Prime 31 released Etcetera Plugin for TTS also once you check that one.but cost is too much high i mean your plugin cost is 25$(i seen last post) but prime 31 cost is 55$.
     
  5. Deleted User

    Deleted User

    Guest

    Prime31's Etcetera plugin does have other features, so keep that in mind.
     
  6. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    We updated the package (v 1.1.0) which will be soon available for download.

    Sorry for the wait.

    A quick reference is now in the readme file:

    public void Init() {
    Initialize the TTS engine

    public bool isInitialized()
    Returning true when the engine is ready speak, false when not.

    public void Speak(string Text)
    Speak the phrase passed in Text string

    public bool isSpeaking()
    Returns if the engine is actually speaking

    public int SetPitch(float thepitch)
    Sets the pitch of the speech

    public int SetSpeechRate(float therate)
    Sets the speech speed rate

    public int SetLanguage(string Text)
    Accepts "inglese" or "english" for us english, any other string will switch to user's device language

    public string GetLanguage()
    Retrieve the current selected language for TTS engine

    public string getAllLanguages()
    Retrieve all the available languages into a single string (space separated)

    public void Dispose()
    Stops, and shutdown the TTS engine.



    Next version will add playSilence and ability to choose among 2 Speak methods QUEUE_FLUSH QUEUE_ADD (now is just queue flush) to be able to speak more sentences at once, and let the engine speak them in line.


    Cheers,
     
    Last edited: Nov 8, 2011
  7. lbalasubbaiahapps

    lbalasubbaiahapps

    Joined:
    Oct 6, 2011
    Posts:
    23
    i have one doubt.Please if you use this plugin Etcetera pluin how many languages will speak.
     
  8. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    I don't know the etcetera.

    It also depends on what your device has installed.
    I think by default (at least on my device) you have english and your native (mine is italian) language.

    With our plugin you can choose among this two.

    In the future the plugin will be able to download more language when not present and so, support the switch among more languages.
     
  9. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    A quick update, we are going to update soon our TTS plugin and also lower the price.
    Bid here for how much would you pay for it.

    Thank you.
     
  10. lbalasubbaiahapps

    lbalasubbaiahapps

    Joined:
    Oct 6, 2011
    Posts:
    23
    Hi Litobyte ,
    in my android project i am using tts.In my project i need two different voices.i mean female and male voice.when i ask prime 31 they told me no voice choice is there in your plugin.Please reply me
     
  11. lbalasubbaiahapps

    lbalasubbaiahapps

    Joined:
    Oct 6, 2011
    Posts:
    23
    Hi Litobyte ,
    in my android project i am using tts.In my project i need two different voices.i mean female and male voice.when i ask prime 31 they told me no voice choice is there in your plugin.Please reply me
     
  12. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    There is not the possibility to change the voice from within the android SDK but, you can install whatever voice you want, even very professional looking voices from SVOX or LOQUENDO or such, to have the TOP for your eg: car navigator.

    A special version of the plug-in can be adjusted for your need for a few bucks, and will add the possibility to make an install check and a voice preview/market link also.
    Also other features are planned to be supported if interest, like the ability to save to disk the audio file generated by the TTS engine and then be able to manipulate it with the great new Audio system furnished with Unity 3.5

    About custom voices, the only thing you can do with Android SDK, then even with our plug-in (just not the version on Asset Store yet) is this:

    Code (csharp):
    1. setEngineByPackageName(String enginePackageName)
    But as you can see, is not so a safe method, so we decide to do not implement this (yet)
    About different, and best voice /TTS engines for Android:

    read here:

    http://blog.recursivepenguin.com/?p=35

    http://svoxmobilevoices.wordpress.com/developers/

    http://www.loquendo.com/en/products/text-to-speech/product-profiles/tts-mobile/loquendo-tts-android/

    Regards,
     
    Last edited: Jan 12, 2012
  13. GreatChicken

    GreatChicken

    Joined:
    Jul 18, 2012
    Posts:
    6
    Hi, is the programmer of the plugin still in this thread?

    I bought the plugin from the Store - the example provided with the plugin compiles for Android for the target platform, 2.3.x to 4.x, but throws an exception during the CallStatic("Init",...) part of the code (which causes the app to crash on the device).

    Build settings: Unity 3.5.3f3, Target platform android 2.3.x (but still works on Android 4.0.3). That should be all that matters.
    I have attempted to roll back to Unity 3.4, and not only was it more trouble than it was worth, it didn't work either.

    Platform: Unity Free w/ the Android and IOS plugins from April.

    Device is Samsung Galaxy SII, Android 4.0.3 stock rooted, debugging enabled - I made sure to select the Google TTS service instead of the Samsung one. The VibratorTTS example works perfectly on the device; can the Player Settings for this demo be posted at least so I can see where I went wrong?
     
  14. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    Hi Great Chicken,

    I'm here yes.
    I have a lot of satisfied customers, within them there's myself, I compiled these APK recently with Unity 3.5.3f and ALL of them contain the vibration plug-in. They haven't any crash problem.

    You should check that the jars are in the right place.

    I guess also making 2.2 - 4.0 ( 8-15 api level) would help since there may be something needed from that sdk release.
    Have you tried compiling 8-15 ? Or even 6-15. The example is compiled with API level 6-15.

    I will post a pic with the plugin folder structure and player settings just in case.
     

    Attached Files:

    Last edited: Jul 18, 2012
  15. GreatChicken

    GreatChicken

    Joined:
    Jul 18, 2012
    Posts:
    6
    Hi,

    Thanks to the folder structure you posted, I figured out the problem. Unity imports the plugin inside a "NativeTTS" folder, and all I had to do is to pull the Plugins and Demoscene directory out to the root directory.

    (This is odd, though, most of the plugins I tried out don't require me to pull things to root...)

    Thanks for the help! :)
     
  16. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    Thank you too for letting me know you sorted out.
    That is probably my mistake, I will be fixing it in the next release.
     
  17. alvaro-em

    alvaro-em

    Joined:
    Feb 23, 2012
    Posts:
    77
    Hi, Litobyte.

    Before buying it, I was wondering... does the user need an internet connection in order to use this plugin?

    Thank you very much in advance.

    Kind regards.

    [EDIT: Sorry, I have just read it is not needed. Thanks!]
     
  18. alvaro-em

    alvaro-em

    Joined:
    Feb 23, 2012
    Posts:
    77
    Hello again.

    I found out the same problem that Breakdown Studio did. Please, fix that, it's annoying to have the files in the root folder. It's obviously a bug with an easy fix and it was reported more than a month ago.

    Kind regards.

    [Edit: Actually it is only needed to have the "Plugin" folder in the root one. You can left the "demoscene" folder in the original location]
     
    Last edited: Sep 3, 2012
  19. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    Thanks for the advice Alvaro, unfortunately we are under pression for at the moment, but we will update the plug-in ASAP after release.
    Meantime, I guess moving a folder isn't all that trouble.

    Thank you for understanding,
     
  20. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    A quick note to Unity 3.5.x and Unity 4 Android users:
    I apology for the delay and thank you again for the patience.
    I should really update the Asset Store packages ASAP. I'll try to do it this week.
    Some user could not figure out this, so I want to add this additional info.


    The problem is about the Manifest file included in the package: Assets/Plugins/Android/AndroidManifest.xml is outdated !!
    The last version of the plugin was uploaded with Unity 3.2, before Unity Tech switched to a different method for embedding Unity player on Android. The quicker fix to this, is to delete this file, and let Unity generate the proper manifest.

    The outdated manifest file, cause the app to crash when autorotation is enabled, and you rotate the device.

    Or you could simply update the file Assets/Plugins/Android/AndroidManifest.xml with a copy of a Unity 3.5 / Unity 4 generated one, then add your stuff).
    Then copy this AndroidManifest.xml file replacing the one in Assets/Plugins/Android/
    It should be it, this fixes the autorotation related and possibly other bug you might have encountered!




    Additional note:

    Before unity 3.4 AndroidManifest.xml <Application> chunk was looking like this:

    Code (csharp):
    1.   <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
    2.    
    3.   <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation" android:screenOrientation="portrait">
    4.               <intent-filter>
    5.                 <action android:name="android.intent.action.MAIN" />
    6.                 <category android:name="android.intent.category.LAUNCHER" />
    7.               </intent-filter>
    8.         </activity>
    9.  </application>
    10.  


    After, it changed to be like:

    Code (csharp):
    1.  
    2.   <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
    3.     <activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
    4.       <intent-filter>
    5.         <action android:name="android.intent.action.MAIN" />
    6.         <category android:name="android.intent.category.LAUNCHER" />
    7.       </intent-filter>
    8.     </activity>
    9.     <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
    10.     </activity>
    11.     <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
    12.       <meta-data android:name="android.app.lib_name" android:value="unity" />
    13.       <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
    14.     </activity>
    15.     <activity android:name="com.unity3d.player.VideoPlayer" android:label="@string/app_name" android:screenOrientation="behind" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    16.     </activity>
    17.   </application>
     
  21. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,059
    Is this still being developed?
     
  22. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    Yes it is.
     
  23. tataparcs

    tataparcs

    Joined:
    Aug 26, 2012
    Posts:
    3
    I already augmented the image in the camera.Then, I need to play the description of the 3D image. Question is, How can I use this plugin in my Augmented Reality project? I need to have a GUI button to play the TTS description of the augmented 3D image. Thank you in advance FiveFingers!
     
  24. Clarenceonline

    Clarenceonline

    Joined:
    Jul 1, 2013
    Posts:
    17
    please help, anybody

    good day sir,


    I bought your program in unity asset store last saturday (september 1,2013) under an account using a credit card and i am currently confused on how to used it.
    I mean how can I see the sample scene because when I drag it in the camera, nothing show and nothing happens
    please give me a step by step instructions on how to deploy the example scene.
    I really need your help and assistance. Im currently a student who is want to use your plug in to my thesis

    please help me as soon as you read this,

    thank you in advance
     
  25. Clarenceonline

    Clarenceonline

    Joined:
    Jul 1, 2013
    Posts:
    17
    Hello sir Im Clarence,

    I saw your post in the forum about the Native Text To Speech Plug in by litobytes

    I bought the plugin last September 3,2013 but I have problems when I deployed them on the Android device.

    I can send you the plug in that I bought together with the scripts and the scene.
    reply to me if you want to get the native tts plug in that i bought from the asset store

    and
    Could you please give me some suggestions regarding my issues?

    here it is in my thread

    http://answers.unity3d.com/questions...comment-529549

    please help me sir, thank you in advance
    sorry for asking you questions. I just really need to make this things work for my school thesis.
    Please REPLY
     
  26. ju4nl

    ju4nl

    Joined:
    Sep 19, 2013
    Posts:
    9
    Hi. It is happenning the same to us. We have just imported the package from asset store into an empty project, and built for Android using the Example. It creates this structure:

    $2014-05-03_2201.png

    but it simply does not work in the device. We have tested with pico and Google's synthesis, but it simply don't work: after the splash screen, a blue screen is shown.

    We have added Example as unique scene to be built, but it is not working.

    Could you please provide some feedback? Did someone found a similar problem?
     
  27. ju4nl

    ju4nl

    Joined:
    Sep 19, 2013
    Posts:
    9
    Added info - technical details:

    We are working with

    Unity 4.3.2f1 (Unity Pro + Android Pro).
    Android 4.1.1
     
  28. ju4nl

    ju4nl

    Joined:
    Sep 19, 2013
    Posts:
    9
    By the way, in plugins/Android there is only one file - AndroidTTSActivity.jar, but no xml.
    in Plugins folder there is:
    Android (folder)
    TTSBridge.cs (script).
     
  29. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    We have just tried to compile it with Unity 4.5.1, working fine here.
    (Mac OSX Maverick, Latest Android Tools)
     
  30. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    Get my Unity3D 4.5.1 Android project here.
    The project is ready to Build&Run, I apology for the test1st.scene file, that should not be there, the Example/Example.scene is the one added to the build settings.

    The project has a simple example scene meant to run on a 480x800 display.
    API Level chosen is 9 (the minimum) as I have a very old Droid with v2.3.1.


    Look at the pic attached,
    I have added a .txt in the Plugins folder so that you can't make it wrong.


    Enjoy,
     

    Attached Files:

    • expl.jpg
      expl.jpg
      File size:
      86.5 KB
      Views:
      1,560
    Last edited: Jun 23, 2014
  31. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    Just out of curiosity Ju4nl, have you:
    - Downloaded updated Android Tools, for your android package manager?
    - Make sure that at least one TTS engine is installed on your phone ?

    If still don't work, try to lower the API level to the minimum in Unity 4 (Api level 9), and try to build again.

    Let me know if you did solve the problem.
     
  32. FultonX

    FultonX

    Joined:
    Sep 7, 2014
    Posts:
    5
    I did everything suggested here and I get this when I try to build your example project:
    Error building Player: Win32Exception: ApplicationName='C:/Program Files (x86)/Android/android-sdk\tools\zipalign.exe', CommandLine='4 "C:\Users\User\Downloads\TTS_U451\TTS_U451\Temp/StagingArea/Package_unaligned.apk" "C:\Users\User\Downloads\TTS_U451\TTS_U451\Temp/StagingArea/Package.apk"', CurrentDirectory='Temp/StagingArea'

    And when I try my own project, it builds and runs but no voice
     
  33. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    It seems that this is your first post on this forum at all :)
    Welcome aboard !

    Are you sure ? Many ppl is using the plug-in with Unity 3.x and Unity 4.x with ease.
    Have you placed the .jar plug-in in the right place ?

    You say you got Building error, I wonder how can you "try your own project, build and runs but no voice" if you got building errors (!?)

    Can you be more specific ?

    Thank you,
     
  34. Linetsis

    Linetsis

    Joined:
    Oct 25, 2013
    Posts:
    4
    Hi FiveFingers, I've recently bought your Native TTS Plugin, I placed the plugins folder just where you said but when I build and run the example scene I receive only a light blue screen and this error:

    "I/Unity (31005): AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='engineInitialized' signature='()Z' in class Lcom/unity3d/Plugin/AndroidTTSActivity;"

    Please answer ASAP.
     
  35. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    I will stop forum support.
    If you want direct fast support for my plug-ins, send me a private message on this forum with your invoice number,
    I will be glad to assist.
     
  36. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    I want to add here that Linetsis, FultonX and Ju4nl have been reported to UT as fake troll users.
    I wish to thanks again the 30 happy legal users that use my plugin and wish they keep up their good work on their games!
     
  37. Linetsis

    Linetsis

    Joined:
    Oct 25, 2013
    Posts:
    4
    Fine, so anyone who tries to test your plugin but have some errors is now a pirate troll.
     
  38. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    If I see 1 or 2 messages in the whole forum, and those messages are here, guess what ? :)
    I'll be glad to help more than two lines of text for any paid users who show the invoice,

    Regards,
     
  39. FiveFingersGames

    FiveFingersGames

    Joined:
    Apr 11, 2013
    Posts:
    2
    The plug-in just works, infact, we do have sales every month, and it is so easy to implement,
    that rarely I receive complaints or helpdesk requests.

    Regards,