जैसे एंड्रॉइड टीटीएस सर्विसेज में मेरा टीटीएस इंजन जोड़ें मैंने एंड्रॉइड में अपने स्वयं के टीटीएस ऐप्स विकसित किए हैं। क्या टीटीएस ऐप चलाने के बजाए ओएस में अपने टीटीएस इंजन को तैनात करने का कोई तरीका है, ताकि अन्य ऐप्स मेरे टीटीएस को कॉल कर सकें? एमएस विंडो में एसएपीआई की तरह कुछ। एसवीओएक्स इंजन को एपीके के रूप में पैकेज कर सकता है और स्थापित होने के बाद, यह एंड्रॉइड ओएस में नए इंजन जोड़ता है, यह सुनिश्चित नहीं है कि मैं यह कैसे कर सकता हूं।एसटीआईआई
एसटीआईआई
उत्तर
उपलब्ध सेवाओं की सूची में आपके टेक्स्ट-टू-स्पीच इंजन को दिखाने के लिए, आपको उपयुक्त गतिविधियां और मैनिफेस्ट प्रविष्टियां जोड़नी होंगी।
एपीआई 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>
इस संदर्भ रेस/xml/tts_engine.xml है, जो इस तरह दिखना चाहिए:
<?xml version="1.0" encoding="utf-8"?>
<tts-engine xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="com.example.MyTtsSettingsActivity" />
आपको विभिन्न प्रकार की सहायक गतिविधियों को भी जोड़ने की आवश्यकता होगी। यहाँ तुम क्या आपके प्रकट करने के लिए जोड़ रहे होंगे है:
<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" />
आप एंड्रॉयड के पूर्व आईसीएस संस्करणों के समर्थन की योजना बना रहे हैं, तो आप भी एक साझा लाइब्रेरी, जो किसी विशेष एपीआई के अनुरूप है की आवश्यकता होगी।
मैं हर गतिविधि के कार्यान्वयन के विवरण में यहाँ जाना होगा नहीं, या पूर्व आईसीएस एपीआई में है, लेकिन आप eSpeak TTS इंजन के एंड्रॉयड बंदरगाह के लिए स्रोत कोड में उदाहरण मिल सकते हैं: http://code.google.com/p/eyes-free/source/browse/trunk/tts/espeak-tts/