コード例 #1
0
ファイル: MainActivity.java プロジェクト: phreakradio/iSwear
  /**
   * Function stops recognizer and switches textview UI
   *
   * @param searchName
   */
  private void switchSearch(String searchName) {
    recognizer.stop();

    // If we are not spotting, start listening with timeout (10000 ms or 10 seconds).
    if (searchName.equals(KWS_SEARCH)) recognizer.startListening(searchName);
    else recognizer.startListening(searchName, 10000);

    String caption = getResources().getString(captions.get(searchName));
    ((TextView) findViewById(R.id.caption_text)).setText(caption);
  }
コード例 #2
0
  private void startListeningSphinx(String searchName) {
    recognizer.stop();

    // If we are not spotting, start listening with timeout (10000 ms or 10 seconds).
    if (searchName.equals(KWS_SEARCH)) recognizer.startListening(searchName);
    /*   else
    // recognizer.startListening(searchName);
    recognizer.startListening(searchName, 10000);*/

    // String caption = getResources().getString(searchName);
    ((TextView) findViewById(R.id.user_help)).setText(R.string.robot_move);
  }