1、推荐下载Android实例Android 实例2015/07/09 0 相关资料: 注意:在手机上必须选安装文字转语音引擎“google Text To Speech”地址:shouji56/soft/GoogleWenZiZhuanYuYinYinQingGoogleTexttoSpeech_3864/ 结果总结: XE10.1 + 小米手机 5 = 通过测试首先手机上必须安装语音包:1.“google Text ToSpeech” (不知为什么我的只发英文)2.“度秘语音引擎 3.0” (中英都可以发音)3.“科大讯飞语音引擎 3.0”(中英都可以发音)4.APK 发音使用的是当前语音包
2、5.小米手机 5-设置-更多设置-语言和输入法-文字转语音(TTS)输出 1.新建一个单元 Androidapi.JNI.TTS 1 * 2 3 CodeGear Delphi Runtime Library 4 Copyright(c) 2013 Jeff Overcash 5 6* 8 Delphitrnslation for TTS Android Java classes from 9 developer.android/reference/android/speech/tts/package-summary.html 11 unitAndroidapi.JNI.TTS; 12 13
3、interface 15 uses Androidapi.JNIBridge, 16Androidapi.JNI.JavaTypes, 17 Androidapi.JNI.Os, 18 Androidapi.JNI.App, 19Androidapi.JNI.GraphicsContentViewText; 20 21 type 23 Forward declarations 24JSynthesisCallback = interface; / android.speech.tts.SynthesisCallback 25JSynthesisRequest = interface; / an
4、droid.speech.tts.SynthesisRequest 26 JTextToSpeech =interface; / android.speech.tts.TextToSpeech 27 JTextToSpeech_Engine = interface; /android.speech.tts.TextToSpeech$Engine 28 JTextToSpeech_EngineInfo = interface;/android.speech.tts.TextToSpeech$EngineInfo 29 JTextToSpeech_OnInitListener =interface
5、; / android.speech.tts.TextToSpeech$OnInitListener 30JTextToSpeech_OnUtteranceCompletedListener = interface; /android.speech.tts.TextToSpeech$OnUtteranceCompletedListener 31JTextToSpeechService = interface; / android.speech.tts.TextToSpeechService 32JUtteranceProgressListener = interface; / android.
6、speech.tts.UtteranceProgressListener 34JSynthesisCallbackClass = interface(IJavaClass) 35 3B30766E-A43B-4005-BE92-472CD075F325 36 end; 37 38JavaSignature(android/speech/tts/SynthesisCallback) 39 JSynthesisCallback =interface(IJavaInstance) 40 190C13DE-BC7E-44CE-94F6-4AF1A84A4612 41function audioAvai
7、lable(buffer: TJavaArray byte offset: Integer; length: Integer): Integer;cdecl; 42 function done: Integer; cdecl; 43 procedure error; cdecl; 44 functiongetMaxBufferSize: Integer; cdecl; 45 function start(sampleRateInHz: Integer;audioFormat: Integer; channelCount: Integer): Integer; cdecl; 46 end; 47
8、TJSynthesisCallback = class(TJavaGenericImport JSynthesisCallbackClass,JSynthesisCallback ) end; 48 49 JSynthesisRequestClass = interface(JObjectClass) 50AE41459D-42C6-4E66-B174-F6FA5216A1DA 51 Method 52 function init(text:JString; params: JBundle): JSynthesisRequest; 53 end; 54 55JavaSignature(andr
9、oid/speech/tts/SynthesisRequest) 56 JSynthesisRequest =interface(JObject) 57 1963DAD8-C58F-4868-BF8A-B43AE7A14145 58 functiongetCountry: JString; cdecl; 59 function getLanguage: JString; cdecl; 60 functiongetParams: JBundle; cdecl; 61 function getPitch: Integer; cdecl; 62 functiongetSpeechRate: Inte
10、ger; cdecl; 63 function getText: JString; cdecl; 64 function getVariant:JString; cdecl; 65 end; 66 TJSynthesisRequest = class(TJavaGenericImportJSynthesisRequestClass, JSynthesisRequest ) end; 67 68 JTextToSpeechClass =interface(JObjectClass) 69 0E2C5E49-95BE-4F19-BCCD-21960D03E957 70 Property Metho
11、ds 71 function_GetACTION_TTS_QUEUE_PROCESSING_COMPLETED: JString; 72 function_GetERROR: Integer; 73 function _GetLANG_AVAILABLE: Integer; 74 function_GetLANG_COUNTRY_AVAILABLE: Integer; 75 function_GetLANG_COUNTRY_VAR_AVAILABLE: Integer; 76 function_GetLANG_MISSING_DATA: Integer; 77 function _GetLAN
12、G_NOT_SUPPORTED:Integer; 78 function _GetQUEUE_ADD: Integer; 79 function _GetQUEUE_FLUSH:Integer; 80 function _GetSUCCESS: Integer; 81 Methods 82 function init(contect:JContext; listener: JTextToSpeech_OnInitListener) : JTextToSpeech; cdecl; overload; 83function init(context: JContext; listener: JTe
13、xtToSpeech_OnInitListener; engine: JString):JTextToSpeech; overload; 84 Properties 85 propertyACTION_TTS_QUEUE_PROCESSING_COMPLETED: JString read_GetACTION_TTS_QUEUE_PROCESSING_COMPLETED; 86 property ERROR:Integer read _GetERROR; 87 property LANG_AVAILABLE: Integer read_GetLANG_AVAILABLE; 88 propert
14、y LANG_COUNTRY_AVAILABLE: Integer read_GetLANG_COUNTRY_AVAILABLE; 89 propertyLANG_COUNTRY_VAR_AVAILABLE: Integer read_GetLANG_COUNTRY_VAR_AVAILABLE; 90 property LANG_MISSING_DATA:Integer read _GetLANG_MISSING_DATA; 91 property LANG_NOT_SUPPORTED:Integer read _GetLANG_NOT_SUPPORTED; 92 property QUEUE
15、_ADD: Integer read_GetQUEUE_ADD; 93 property QUEUE_FLUSH: Integer read _GetQUEUE_FLUSH;94 property SUCCESS: Integer read _GetSUCCESS; 95 end; 96 97JavaSignature(android/speech/tts/TextToSpeech) 98 JTextToSpeech =interface(JObject) 99 E1D06364-F967-4381-B178-EEDD42C203C7 100 functionaddEarcon(earcon: JString; filename: JString): Integer; cdecl; overload; 101 functionaddEarcon(earcon: JString; packagename: JString; resourceID: I
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1