Results 1 to 3 of 3
  1. #1
    raj.mscking@gmail.com's Avatar
    raj.mscking@gmail.com is offline Senior Member
    Join Date
    Jan 2012
    Location
    TamilNadu
    Posts
    292
    Rep Power
    3

    Default Android Locale in not working on text to speech

    Hi!

    I am having problem in my news application, the specifications are..,

    1) swiping right,left,top & down with animation effect
    2) the display text should be Indian language
    3) when swiping it should read the titles in local language,

    i did every thing except the 3rd one even though if in mention the local as

    Java Code:
    int result = tts.setLanguage(new Locale("tam"));
    it speak on US English only..,

    my code is

    Java Code:
    	@Override
    	public void onDestroy() {
    		// Don't forget to shutdown!
    		if (tts != null) {
    			tts.stop();
    			tts.shutdown();
    		}
    		super.onDestroy();
    	}
    
    	@Override
    	public void onInit(int status) {
    		// TODO Auto-generated method stub
    
    		if (status == TextToSpeech.SUCCESS) {
    
    			int result = tts.setLanguage(new Locale("tam"));
    
    			if (result == TextToSpeech.LANG_MISSING_DATA
    					|| result == TextToSpeech.LANG_NOT_SUPPORTED) {
    				Log.e("TTS", "Language is not supported");
    			} else {
    				// speakOut();
    			}
    
    		} else {
    			Log.e("TTS", "Initilization Failed");
    		}
    
    	}
    
    	private void speakOut(String txt) {
    
    		tts.speak(txt, TextToSpeech.QUEUE_FLUSH, null);
    	}


    speakOut(txt_content_id.getText().toString());
    can anyone guide me please..,

    Thank You!

    Have A Happy Day..,
    Last edited by raj.mscking@gmail.com; 12-28-2013 at 11:39 AM.
    - Raj

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: Android Locale in not working on text to speech

    It sounds like your expecation is that TextToSpeech will translate the text it's reading. It doesn't do that.

    Is "tam" an ISO 639 language code?
    Get in the habit of using standard Java naming conventions!

  3. #3
    raj.mscking@gmail.com's Avatar
    raj.mscking@gmail.com is offline Senior Member
    Join Date
    Jan 2012
    Location
    TamilNadu
    Posts
    292
    Rep Power
    3

    Default Re: Android Locale in not working on text to speech

    Thank You Mr.kjkrum!

    But in an other blog i have read the answer, they said it possible. but i dont know that way how to do it sir..,
    - Raj

Similar Threads

  1. Text to Speech,help me
    By kienkun1990 in forum Advanced Java
    Replies: 3
    Last Post: 09-16-2012, 06:59 AM
  2. change locale not working - please help me
    By mikmontana in forum Web Frameworks
    Replies: 6
    Last Post: 12-07-2011, 09:41 PM
  3. Speech To Text
    By jyothi.priyanka in forum Advanced Java
    Replies: 1
    Last Post: 12-04-2011, 12:44 PM
  4. Text To Speech
    By jyothi.priyanka in forum Advanced Java
    Replies: 0
    Last Post: 02-24-2011, 06:00 PM
  5. speech to text concersion
    By ak88 in forum Advanced Java
    Replies: 1
    Last Post: 03-09-2010, 09:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •