在android wear action中更改语音识别器的语言

在android wear action中更改语音识别器的语言,android,localization,wear-os,voice-recognition,Android,Localization,Wear Os,Voice Recognition,在我的android应用程序中,我创建了一个带有磨损功能的通知,并添加了一个动作来识别语音输入并将语音文本发送到另一个活动。我的问题是,它只是识别谷歌现在设置英语中选择的语言,我想从波斯语语音。这是我的代码: RemoteInput remoteInput = new RemoteInput.Builder("My_Const_String") .setLabel("label when you talk") .build(); Intent replayIntent = n

在我的android应用程序中,我创建了一个带有磨损功能的通知,并添加了一个动作来识别语音输入并将语音文本发送到另一个活动。我的问题是,它只是识别谷歌现在设置英语中选择的语言,我想从波斯语语音。这是我的代码:

RemoteInput remoteInput  = new RemoteInput.Builder("My_Const_String")
    .setLabel("label when you talk")
    .build();

Intent replayIntent = new Intent(context, MyTestActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, replayIntent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Action action = new NotificationCompat.Action.Builder(
        R.drawable.ic_btn, "Label when confirm your talk", pendingIntent)
        .addRemoteInput(remoteInput)
        .build();

NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
builder.setContentTitle("Title")
    .setContentText("Content text")
    .setSmallIcon(R.drawable.ic_stat_name)
    .setContentText("My text02");

NotificationCompat.WearableExtender extender =
        new NotificationCompat.WearableExtender();

extender.addAction(action);
builder.extend(extender);

NotificationManagerCompat mgr = NotificationManagerCompat.from(context);
int NotificatinId = 1;
mgr.notify(NotificatinId, builder.build());
另外,我不想强迫用户现在手动更改谷歌的设置。我尝试添加额外的内容,如下面所示,但不起作用:

Intent i = new Intent();
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "fa_IR");
i.putExtra(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES, "fa_IR");
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "fa");
Bundle bundle = new Bundle();
bundle = i.getExtras();

RemoteInput remoteInput  = new RemoteInput.Builder("My_Const_String")
    .setLabel("label when you talk")
    .addExtras(bundle)
    .build();

它的作品与法语和俄语很相配。我想现在还不支持。看看与语音输入部分配合使用的语言。

它可以与法语和俄语配合使用。我想现在还不支持。看看与语音输入部分一起工作的语言。

波斯语和波斯语都是相同的,谷歌支持这两种语言。在你的手机上,在谷歌应用程序>设置>语音>语言中,你只检查了英语还是检查了其他语言?波斯语和波斯语都是一样的,谷歌支持。在您的手机上,在谷歌应用程序>设置>语音>语言中,您是只检查了英语还是也检查了其他语言?