Google Wear 사이트의 자유 형식 음성 입력을 사용하려고했습니다.에메이터의 Google Wear 음성 인식기에 음성 입력 없음
hello world 예제에서 textView를 클릭하기 만했습니다. Speech Intent에서 Speak Now 액티비티를 가져 오지만 에뮬레이터는 마이크에서 어떤 사운드도 감지 할 수 없었습니다.
저는 Mac OS 10.9.3을 사용 중이며, wear watch의 arm 및 intel 버전을 모두 사용해 보았습니다. AVD 생성시 하드웨어 키보드를 확인했습니다. 설명서에는 시스템에 내장 된 음성 인식기가있어 모바일 에뮬레이터에서와 같이 Google 보이스 앱을 설치하는 것이 잘못된 답변 인 것 같습니다. 안드로이드 에뮬레이터는 음성을 지원하지 않습니다 -
public class MainActivity extends Activity {
private TextView mTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub stub) {
mTextView = (TextView) stub.findViewById(R.id.text);
mTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
displaySpeechRecognizer();
}
});
}
});
}
private static final int SPEECH_REQUEST_CODE = 0;
// Create an intent that can start the Speech Recognizer activity
private void displaySpeechRecognizer() {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
// Start the activity, the intent will be populated with the speech text
startActivityForResult(intent, SPEECH_REQUEST_CODE);
}
// This callback is invoked when the Speech Recognizer returns.
// This is where you process the intent and extract the speech text from the intent.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == SPEECH_REQUEST_CODE && resultCode == RESULT_OK) {
List<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
String spokenText = results.get(0);
// Do something with spokenText
}
super.onActivityResult(requestCode, resultCode, data);
}
가}
나에게 몇 초 전에 대답했습니다 :) 예, 에뮬레이터는 음성 입력을 지원하지 않습니다. 이를 위해서는 실제 장치가 필요합니다. – matiash