Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7613269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:06:53+00:00 2026-05-31T02:06:53+00:00

How i change audio input and output language in my android code? Should i

  • 0

How i change audio input and output language in my android code? Should i edit this code to change audio input output language ? {I want to set one variable to En to speech language English or set variable to Tr to select Turkish if this possible?}

 public Intent getRecognizeIntent()
    { 
        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_PROMPT, prompt);
        intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 100);
        return intent;
    }

Or this help me to change? -> EXTRA_LANGUAGE_PREFERENCE

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:06:54+00:00Added an answer on May 31, 2026 at 2:06 am

    This should work in most cases:

    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en");
    

    or

    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, Locale.getDefault());
    

    Where you pick the locale you want and pass it’s toString() to EXTRA_LANGUAGE_PREFERENCE

    However, to be correct, you should try doing a language check, and observing the returned “voices”. Manually or automatically, pick the “voice” string you want and then use that for the RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE value.

    Here is some code to execute the language check:

    public static void getLanguageDetails(Context context,
            OnLanguageDetailsListener andThen)
    {
        Intent detailsIntent = new Intent(
                RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS);
        LanguageDetailsChecker checker = new LanguageDetailsChecker(andThen);
        context.sendOrderedBroadcast(detailsIntent, null, checker, null,
                Activity.RESULT_OK, null, null);
    }
    

    where LanguageDetailsChecker is something like this:

    public class LanguageDetailsChecker extends BroadcastReceiver
    {
        private List<String> supportedLanguages;
    
        private String languagePreference;
    
        @Override
        public void onReceive(Context context, Intent intent)
        {
            Bundle results = getResultExtras(true);
            if (results.containsKey(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE))
            {
                languagePreference =
                        results.getString(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE);
            }
            if (results.containsKey(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES))
            {
                supportedLanguages =
                        results.getStringArrayList(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES);
            }
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ContentObserver registered to android.provider.Settings.System that should observe changes of any audio
What are the different ways to change the playback speed of audio on the
I have a serie of video files encoded in mpeg2 (I can change this
I want to change the src attribute of a tag using javascript and a
Seeking through an audio file based on the packet level is simple. One just
I want to modify the apple's sample code of auriotouch to generate the waveform
I am not familiar with flash, and I would like to change an audio
I need to change the output sample rate from 44.1 to 32.0, but it
OK, I don't know how to word this question, but maybe my code will
How can I programatically change the default audio device on a vista / win

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.