将我的TTS引擎添加到Android TTS服务,如SAPI

将我的TTS引擎添加到Android TTS服务,如SAPI,android,text-to-speech,Android,Text To Speech,我已经在Android上开发了自己的TTS应用程序。有没有办法在运行TTS应用程序时将我的TTS引擎部署到操作系统中,以便其他应用程序可以调用我的TTS?类似微软视窗中的SAPI。SVOX可以将引擎打包为apk,安装后,它会将新引擎添加到ANDROID操作系统中,但不知道如何才能做到这一点。要使文本语音引擎显示在可用服务列表中,您需要添加适当的活动和清单条目 对于API 14及以上版本,您需要扩展TextToSpeechService,并需要将以下内容添加到清单中: <servic

我已经在Android上开发了自己的TTS应用程序。有没有办法在运行TTS应用程序时将我的TTS引擎部署到操作系统中,以便其他应用程序可以调用我的TTS?类似微软视窗中的SAPI。SVOX可以将引擎打包为apk,安装后,它会将新引擎添加到ANDROID操作系统中,但不知道如何才能做到这一点。

要使文本语音引擎显示在可用服务列表中,您需要添加适当的活动和清单条目

对于API 14及以上版本,您需要扩展TextToSpeechService,并需要将以下内容添加到清单中:

    <service
        android:name=".MyTextToSpeechService"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.TTS_SERVICE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
        <meta-data
            android:name="android.speech.tts"
            android:resource="@xml/tts_engine" />
    </service>
    <activity
        android:name=".DownloadVoiceData"
        android:theme="@android:style/Theme.Dialog" >
        <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: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: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>
    <activity
        android:name=".TtsSettingsActivity"
        android:label="@string/tts_settings_label" >
        <intent-filter>
            <action android:name="android.speech.tts.engine.CONFIGURE_ENGINE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

    <!-- Legacy code for pre-ICS compatibility. -->
    <activity
        android:name=".MyTtsEngine"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" >
        <intent-filter>
            <action android:name="android.intent.action.START_TTS_ENGINE" />
        </intent-filter>
    </activity>

    <provider
        android:name="com.googlecode.eyesfree.espeak.providers.SettingsProvider"
        android:authorities="com.googlecode.eyesfree.espeak.providers.SettingsProvider" />

    <activity
        android:name=".DownloadVoiceData"
        android:theme="@android:style/Theme.Dialog" >
        <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: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: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>
    <activity
        android:name=".TtsSettingsActivity"
        android:label="@string/tts_settings_label" >
        <intent-filter>
            <action android:name="android.speech.tts.engine.CONFIGURE_ENGINE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

    <!-- Legacy code for pre-ICS compatibility. -->
    <activity
        android:name=".MyTtsEngine"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" >
        <intent-filter>
            <action android:name="android.intent.action.START_TTS_ENGINE" />
        </intent-filter>
    </activity>

    <provider
        android:name="com.googlecode.eyesfree.espeak.providers.SettingsProvider"
        android:authorities="com.googlecode.eyesfree.espeak.providers.SettingsProvider" />