android中的tts服务解释
我对android的tts服务的实现有疑问。 交易如下: -我查看了Flite代码,我发现服务需要具备以下3项活动:android中的tts服务解释,android,service,text-to-speech,flite,Android,Service,Text To Speech,Flite,我对android的tts服务的实现有疑问。 交易如下: -我查看了Flite代码,我发现服务需要具备以下3项活动: <activity android:name=".DownloadVoiceData" android:label="@string/flite_voice_manager" android:theme="@android:style/Theme.Holo" android:configChanges="or
<activity
android:name=".DownloadVoiceData"
android:label="@string/flite_voice_manager"
android:theme="@android:style/Theme.Holo"
android:configChanges="orientation">
<intent-filter>
<action android:name="android.speech.tts.engine.INSTALL_TTS_DATA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".CheckVoiceData"
android:label="@string/app_name"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
<intent-filter>
<action android:name="android.speech.tts.engine.CHECK_TTS_DATA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".GetSampleText"
android:label="@string/app_name"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
<intent-filter>
<action android:name="android.speech.tts.engine.GET_SAMPLE_TEXT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
这些活动的实际行动是可以自我解释的,但我想知道:
它们是强制性的吗,它们是如何工作的。。。。我用谷歌搜索过,但运气不好
Thanx提前。
检查语音数据
是必要的,因为客户端可能会调用它,以了解引擎是否工作。
我想你至少可以在一段时间内没有另外两个
<activity android:name=".CheckVoiceData"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.speech.tts.engine.CHECK_TTS_DATA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
有效语言字符串的一个例子是
“eng USA”
您想实现什么,在正常情况下,您不必担心这些类/活动,因为它们是由tts引擎自动调用的?我想了解更多关于它们的信息。我应该为每个活动提供哪些数据,在xml中包含哪些组件?我需要它们吗?如果我想通过usb等上传到设备音频文件,那该怎么办?对不起,我之前的回答是,我说的是ASR,无论如何,这里是android的文档链接,android也使用pico tts引擎,以防你想知道它自己的引擎。对不起,这对我没什么帮助。我会看得更远。当我找到它的解释,我会把它贴在这里。同时,我要感谢我先生,并请其他人作出贡献:)
ArrayList<String> askedToCheck = intent.getStringArrayListExtra(TextToSpeech.Engine.EXTRA_CHECK_VOICE_DATA_FOR);
// if it is null, they usually check and report all available languages.
ArrayList<String> available = new ArrayList<String>();
ArrayList<String> unavailable = new ArrayList<String>();
//...
Intent returnData = new Intent();
returnData.putStringArrayListExtra(
TextToSpeech.Engine.EXTRA_AVAILABLE_VOICES, available);
returnData.putStringArrayListExtra(
TextToSpeech.Engine.EXTRA_UNAVAILABLE_VOICES, unavailable);
setResult(result, returnData);
finish();