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 8741211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:16:16+00:00 2026-06-13T11:16:16+00:00

I am having difficulty in framing this question but anyways here it goes, I

  • 0

I am having difficulty in framing this question but anyways here it goes, I have made two applications basically the TextToSpeech app and the SpeechToText application. They are working fine, now I am trying to merge them. Basically I want the the text to speech part to say the text entered in a text field , only if the user says the word “speak”.That would be done using the speech to text part. Now the problem I am having is that android displays a list of outputs when the user says something, but I only one output that is “Speak” . How can I get only one output instead of a list.

Initially the app becomes active on button click.

The code I am trying is as follows:

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
            RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    i.putExtra(RecognizerIntent.EXTRA_PROMPT, "system Activated");
    startActivityForResult(i, check);

}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub

    if (requestCode == check && resultCode == RESULT_OK) {
        String command = data
            .getStringExtra(RecognizerIntent.EXTRA_RESULTS).toString();
        if (command.equals(command_verify)) {
            speak();
        } else
            finish();
    }

    super.onActivityResult(requestCode, resultCode, data);
}

public void speak() {
    String text_to_speak = message_field.getText().toString();
    talk.speak(text_to_speak, TextToSpeech.QUEUE_FLUSH, null);
}
  • 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-06-13T11:16:17+00:00Added an answer on June 13, 2026 at 11:16 am

    The Voice Recognizer returns you a list of guesses, where the first guess is the most accurate. You can use it calling list.get(0). Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and
I'm having difficulty with this problem. I have a table with this structure: OrderID
I'm having difficulty using two django crispy forms simultaneously. I have one form to
I'm essentially having difficulty pass dynamic variables to a view. I have php functions
I'm having difficulty understanding variable shadowing in JavaScript based on scopes. Consider this small
Having difficulty checking (checkbox) all nodes by a specific class here is what i
Having difficulty making my javascript act the way I want. I have a button,
I'm having difficulty constructing a non-www to www permanent redirect. Here are the conditions
Having difficulty finding relevant search results... Given this model: public abstract class A {
I'm having difficulty getting my textarea to expand vertically automatically. I have some code

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.