调用GOOGLE的TTS实现文字转语音(XE7+小米2)(XE10.1+小米5)
相关资料:
注意:在手机上必须选安装文字转语音引擎“google Text To Speech”
地址:http://www.shouji56.com/soft/GoogleWenZiZhuanYuYinYinQingGoogleTexttoSpeech_3864/
结果总结:
XE10.1 + 小米手机5 = 通过测试
首先手机上必须安装语音包:
1.“google Text To Speech” (不知为什么我的只发英文)
2.“度秘语音引擎3.0” (中英都可以发音)
3.“科大讯飞语音引擎3.0”(中英都可以发音)
4.APK发音使用的是当前语音包
5.小米手机5-设置-更多设置-语言和输入法-文字转语音(TTS)输出
1. 新建一个单元Androidapi.JNI.TTS
{*******************************************************}
{ }
{ CodeGear Delphi Runtime Library }
{ Copyright(c) 2013 Jeff Overcash }
{ }
{*******************************************************} { Delphi trnslation for TTS Android Java classes from }
{ http://developer.android.com/reference/android/speech/tts/package-summary.html } unit Androidapi.JNI.TTS; interface uses Androidapi.JNIBridge,
Androidapi.JNI.JavaTypes,
Androidapi.JNI.Os,
Androidapi.JNI.App,
Androidapi.JNI.GraphicsContentViewText; type {Forward declarations}
JSynthesisCallback = interface; // android.speech.tts.SynthesisCallback
JSynthesisRequest = interface; // android.speech.tts.SynthesisRequest
JTextToSpeech = interface; // android.speech.tts.TextToSpeech
JTextToSpeech_Engine = interface; // android.speech.tts.TextToSpeech$Engine
JTextToSpeech_EngineInfo = interface; //android.speech.tts.TextToSpeech$EngineInfo
JTextToSpeech_OnInitListener = interface; // android.speech.tts.TextToSpeech$OnInitListener
JTextToSpeech_OnUtteranceCompletedListener = interface; // android.speech.tts.TextToSpeech$OnUtteranceCompletedListener
JTextToSpeechService = interface; // android.speech.tts.TextToSpeechService
JUtteranceProgressListener = interface; // android.speech.tts.UtteranceProgressListener JSynthesisCallbackClass = interface(IJavaClass)
['{3B30766E-A43B-4005-BE92-472CD075F325}']
end; [JavaSignature('android/speech/tts/SynthesisCallback')]
JSynthesisCallback = interface(IJavaInstance)
['{190C13DE-BC7E-44CE-94F6-4AF1A84A4612}']
function audioAvailable(buffer: TJavaArray<byte>; offset: Integer; length: Integer): Integer; cdecl;
function done: Integer; cdecl;
procedure error; cdecl;
function getMaxBufferSize: Integer; cdecl;
function start(sampleRateInHz: Integer; audioFormat: Integer; channelCount: Integer): Integer; cdecl;
end;
TJSynthesisCallback = class(TJavaGenericImport<JSynthesisCallbackClass, JSynthesisCallback>) end; JSynthesisRequestClass = interface(JObjectClass)
['{AE41459D-42C6-4E66-B174-F6FA5216A1DA}']
{ Method }
function init(text: JString; params: JBundle): JSynthesisRequest;
end; [JavaSignature('android/speech/tts/SynthesisRequest')]
JSynthesisRequest = interface(JObject)
['{1963DAD8-C58F-4868-BF8A-B43AE7A14145}']
function getCountry: JString; cdecl;
function getLanguage: JString; cdecl;
function getParams: JBundle; cdecl;
function getPitch: Integer; cdecl;
function getSpeechRate: Integer; cdecl;
function getText: JString; cdecl;
function getVariant: JString; cdecl;
end;
TJSynthesisRequest = class(TJavaGenericImport<JSynthesisRequestClass, JSynthesisRequest>) end; JTextToSpeechClass = interface(JObjectClass)
['{0E2C5E49-95BE-4F19-BCCD-21960D03E957}']
{ Property Methods }
function _GetACTION_TTS_QUEUE_PROCESSING_COMPLETED: JString;
function _GetERROR: Integer;
function _GetLANG_AVAILABLE: Integer;
function _GetLANG_COUNTRY_AVAILABLE: Integer;
function _GetLANG_COUNTRY_VAR_AVAILABLE: Integer;
function _GetLANG_MISSING_DATA: Integer;
function _GetLANG_NOT_SUPPORTED: Integer;
function _GetQUEUE_ADD: Integer;
function _GetQUEUE_FLUSH: Integer;
function _GetSUCCESS: Integer;
{ Methods }
function init(contect: JContext; listener: JTextToSpeech_OnInitListener) : JTextToSpeech; cdecl; overload;
function init(context: JContext; listener: JTextToSpeech_OnInitListener; engine: JString): JTextToSpeech; overload;
{ Properties }
property ACTION_TTS_QUEUE_PROCESSING_COMPLETED: JString read _GetACTION_TTS_QUEUE_PROCESSING_COMPLETED;
property ERROR: Integer read _GetERROR;
property LANG_AVAILABLE: Integer read _GetLANG_AVAILABLE;
property LANG_COUNTRY_AVAILABLE: Integer read _GetLANG_COUNTRY_AVAILABLE;
property LANG_COUNTRY_VAR_AVAILABLE: Integer read _GetLANG_COUNTRY_VAR_AVAILABLE;
property LANG_MISSING_DATA: Integer read _GetLANG_MISSING_DATA;
property LANG_NOT_SUPPORTED: Integer read _GetLANG_NOT_SUPPORTED;
property QUEUE_ADD: Integer read _GetQUEUE_ADD;
property QUEUE_FLUSH: Integer read _GetQUEUE_FLUSH;
property SUCCESS: Integer read _GetSUCCESS;
end; [JavaSignature('android/speech/tts/TextToSpeech')]
JTextToSpeech = interface(JObject)
['{E1D06364-F967-4381-B178-EEDD42C203C7}']
function addEarcon(earcon: JString; filename: JString): Integer; cdecl; overload;
function addEarcon(earcon: JString; packagename: JString; resourceID: Integer): Integer; cdecl; overload;
function addSpeech(text: JString; filename: JString): Integer; cdecl; overload;
function addSpeech(text: JString; packagename: JString; resourceID: Integer) : Integer; cdecl; overload;
function areDefaultsEnforced: Boolean; cdecl;
function getDefaultEngine: JString; cdecl;
function getEngines: JList; cdecl;
function getFeatures(locale: JLocale): JSet; cdecl;
function getLanguage: JLocale; cdecl;
function isLanguageAvailable(loc: JLocale): Integer; cdecl;
function isSpeaking: Boolean; cdecl;
function playEarcon(earcon: JString; queueMode: Integer; params: JHashMap) : Integer; cdecl;
function playSilence(durationInMs: Int64; queueMode: Integer; params: JHashMap): Integer; cdecl;
function setEngineByPackageName(enginePackageName: JString): Integer; cdecl;
function setLanguage(loc: JLocale): Integer; cdecl;
function setOnUtteranceCompletedListener(listener: JTextToSpeech_OnUtteranceCompletedListener): Integer; cdecl;
function setOnUtteranceProgressListener(listener: JUtteranceProgressListener): Integer; cdecl;
function setPitch(pitch: Single): Integer; cdecl;
function setSpeechRate(speechRate: Single): Integer; cdecl;
procedure shutdown; cdecl;
function speak(text: JString; queueMode: Integer; params: JHashMap) : Integer; cdecl;
function stop: Integer; cdecl;
function synthesizeToFile(text: JString; params: JHashMap; filename: String) : Integer; cdecl;
end;
TJTextToSpeech = class(TJavaGenericImport<JTextToSpeechClass, JTextToSpeech>) end; JTextToSpeech_EngineClass = interface(JObjectClass)
['{8516EA75-A410-4EEE-8281-9ABCE1577F46}']
{ Property Methods }
function _GeCHECK_VOICE_DATA_PASS: Integer;
function _GetACTION_CHECK_TTS_DATA: JString;
function _GetACTION_INSTALL_TTS_DATA: JString;
function _GetACTION_TTS_DATA_INSTALLED: JString;
function _GetCHECK_VOICE_DATA_BAD_DATA: Integer;
function _GetCHECK_VOICE_DATA_FAIL: Integer;
function _GetCHECK_VOICE_DATA_MISSING_DATA: Integer;
function _GetCHECK_VOICE_DATA_MISSING_VOLUME: Integer;
function _GetDEFAULT_STREAM: Integer;
function _GetEXTRA_AVAILABLE_VOICES: JString;
function _GetEXTRA_CHECK_VOICE_DATA_FOR: JString;
function _GetEXTRA_TTS_DATA_INSTALLED: JString;
function _GetEXTRA_UNAVAILABLE_VOICES: JString;
function _GetEXTRA_VOICE_DATA_FILES: JString;
function _GetEXTRA_VOICE_DATA_FILES_INFO: JString;
function _GetEXTRA_VOICE_DATA_ROOT_DIRECTORY: JString;
function _GetINTENT_ACTION_TTS_SERVICE: JString;
function _GetKEY_FEATURE_EMBEDDED_SYNTHESIS: JString;
function _GetKEY_FEATURE_NETWORK_SYNTHESIS: JString;
function _GetKEY_PARAM_PAN: JString;
function _GetKEY_PARAM_STREAM: JString;
function _GetKEY_PARAM_UTTERANCE_ID: JString;
function _GetKEY_PARAM_VOLUME: JString;
function _GetSERVICE_META_DATA: JString;
{ Methods }
function init: JTextToSpeech_Engine;
{ Properties }
property ACTION_CHECK_TTS_DATA: JString read _GetACTION_CHECK_TTS_DATA;
property ACTION_INSTALL_TTS_DATA: JString read _GetACTION_INSTALL_TTS_DATA;
property ACTION_TTS_DATA_INSTALLED: JString read _GetACTION_TTS_DATA_INSTALLED;
property CHECK_VOICE_DATA_BAD_DATA: Integer read _GetCHECK_VOICE_DATA_BAD_DATA;
property CHECK_VOICE_DATA_FAIL: Integer read _GetCHECK_VOICE_DATA_FAIL;
property CHECK_VOICE_DATA_MISSING_DATA: Integer read _GetCHECK_VOICE_DATA_MISSING_DATA;
property CHECK_VOICE_DATA_MISSING_VOLUME: Integer read _GetCHECK_VOICE_DATA_MISSING_VOLUME;
property CHECK_VOICE_DATA_PASS: Integer read _GeCHECK_VOICE_DATA_PASS;
property DEFAULT_STREAM: Integer read _GetDEFAULT_STREAM;
property EXTRA_AVAILABLE_VOICES: JString read _GetEXTRA_AVAILABLE_VOICES;
property EXTRA_CHECK_VOICE_DATA_FOR: JString read _GetEXTRA_CHECK_VOICE_DATA_FOR;
property EXTRA_TTS_DATA_INSTALLED: JString read _GetEXTRA_TTS_DATA_INSTALLED;
property EXTRA_UNAVAILABLE_VOICES: JString read _GetEXTRA_UNAVAILABLE_VOICES;
property EXTRA_VOICE_DATA_FILES: JString read _GetEXTRA_VOICE_DATA_FILES;
property EXTRA_VOICE_DATA_FILES_INFO: JString read _GetEXTRA_VOICE_DATA_FILES_INFO;
property EXTRA_VOICE_DATA_ROOT_DIRECTORY: JString read _GetEXTRA_VOICE_DATA_ROOT_DIRECTORY;
property INTENT_ACTION_TTS_SERVICE: JString read _GetINTENT_ACTION_TTS_SERVICE;
property KEY_FEATURE_EMBEDDED_SYNTHESIS: JString read _GetKEY_FEATURE_EMBEDDED_SYNTHESIS;
property KEY_FEATURE_NETWORK_SYNTHESIS: JString read _GetKEY_FEATURE_NETWORK_SYNTHESIS;
property KEY_PARAM_PAN: JString read _GetKEY_PARAM_PAN;
property KEY_PARAM_STREAM: JString read _GetKEY_PARAM_STREAM;
property KEY_PARAM_UTTERANCE_ID: JString read _GetKEY_PARAM_UTTERANCE_ID;
property KEY_PARAM_VOLUME: JString read _GetKEY_PARAM_VOLUME;
property SERVICE_META_DATA: JString read _GetSERVICE_META_DATA;
end; JTextToSpeech_Engine = interface(JObject)
['{5BAC3048-CB0C-4DC4-AF62-D0D9AE4394CF}']
end;
TJTextToSpeech_Engine = class(TJavaGenericImport<JTextToSpeech_EngineClass, JTextToSpeech_Engine>) end; JTextToSpeech_EngineInfoClass = interface(JObjectClass)
['{8297AD59-5A6F-4867-A185-CA09BAD90159}']
{Methods}
function init : JTextToSpeech_EngineInfo;
end; JTextToSpeech_EngineInfo = interface(JObject)
['{204B30D8-6E25-4531-847D-18588D48D9BF}']
{property Methods}
function _Geticon: integer;
function _Getlabel: JString;
function _Getname: JString;
procedure _Seticon(const Value: integer);
procedure _Setlabel(const Value: JString);
procedure _Setname(const Value: JString);
{Properties}
property icon : integer read _Geticon write _Seticon;
property _label : JString read _Getlabel write _Setlabel;
property name : JString read _Getname write _Setname;
end;
TJTextToSpeech_EngineInfo = class(TJavaGenericImport<JTextToSpeech_EngineInfoClass, JTextToSpeech_EngineInfo>) end; JTextToSpeech_OnInitListenerClass = interface(IJavaClass)
['{58D32EFB-6528-4EC6-BA4F-28B22FE8E573}']
end; [JavaSignature('android/speech/tts/TextToSpeech$OnInitListener')]
JTextToSpeech_OnInitListener = interface(IJavaInstance)
['{027DA109-680A-4A69-905D-F62E2BD1282F}']
procedure onInit(status: Integer); cdecl;
end;
TJTextToSpeech_OnInitListener = class(TJavaGenericImport<JTextToSpeech_OnInitListenerClass,JTextToSpeech_OnInitListener>) end; JTextToSpeech_OnUtteranceCompletedListenerClass = interface(IJavaClass)
['{0A608BB9-A6BF-4746-8419-9317AD625DFA}']
end; [JavaSignature('android/speech/tts/TextToSpeech$OnUtteranceCompletedListener')]
JTextToSpeech_OnUtteranceCompletedListener = interface(IJavaInstance)
['{00439F2B-E73C-4B93-A9E3-832AE3CC1D5F}']
procedure onUtteranceCompleted(utteranceID: JString); cdecl;
end;
TJTextToSpeech_OnUtteranceCompletedListener = class(TJavaGenericImport<JTextToSpeech_OnUtteranceCompletedListenerClass, JTextToSpeech_OnUtteranceCompletedListener>) end; JTextToSpeechServiceClass = interface(JServiceClass)
['{6BCC6ADC-CBCB-4515-A5C3-E33F9787EEC2}']
function init : JTextToSpeechService;
end; [JavaSignature('android/speech/tts/TextToSpeechService')]
JTextToSpeechService = interface(JService)
['{EE3943B6-88DC-488B-9E10-E0FA9914708D}']
function onGetFeaturesForLanguage(lang : JString; country : JString; variant : JString) : JSet; cdecl;
function onGetLanguage : TJavaArray<JString>; cdecl;
function onIsLanguageAvailable(lang : JString; country : JString; variant : JString) : Integer; cdecl;
function onLoadLanguage(lang : JString; country : JString; variant : JString) : Integer; cdecl;
procedure onStop; cdecl;
procedure onSynthesizeText(request : JSynthesisRequest; callback : JSynthesisCallback); cdecl;
end;
TJTextToSpeechService = class(TJavaGenericImport<JTextToSpeechServiceClass, JTextToSpeechService>) end; JUtteranceProgressListenerClass = interface(JObjectClass)
['{0870532F-6FD7-4B1F-9DEF-B53F0095C98A}']
{ Method }
function init: JUtteranceProgressListener;
end; [JavaSignature('android/speech/tts/UtteranceProgressListener')]
JUtteranceProgressListener = interface(JObject)
['{8B03499D-0B26-4F36-90E8-F724BD78DB0C}']
procedure onDone(utteranceID: JString); cdecl;
procedure onError(utteranceID: JString); cdecl;
procedure onStart(utteranceID: JString); cdecl;
end; TJUtteranceProgressListener = class(TJavaGenericImport<JUtteranceProgressListenerClass, JUtteranceProgressListener>) end; implementation end.
2.实例代码
{********************************************************}
{ XE10.1 + 小米手机5 = 通过测试 }
{ 首先手机上必须安装语音包 }
{ 语音包有 }
{ 1.“google Text To Speech” (不知为什么我的只发英文) }
{ 2.“度秘语音引擎3.0” (中英都可以发音) }
{ 3.“科大讯飞语音引擎3.0”(中英都可以发音) }
{ 4.APK发音使用的是当前语音包 }
{ 5.设置-更多设置-语言和输入法-文字转语音(TTS)输出 }
{********************************************************} unit Unit1; interface uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.ScrollBox,
FMX.Memo, FMX.Controls.Presentation, FMX.StdCtrls,
//需要引入的单元
FMX.Helpers.Android,//引
Androidapi.Helpers,//引入
Androidapi.JNIBridge,//引入
Androidapi.Jni.JavaTypes,//引入
Androidapi.JNI.TTS;//引入 type
TForm1 = class(TForm)
Button1: TButton;//发音
Button2: TButton;//初始化
Memo1: TMemo;//内容,可以是英语,可以是中文
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
type
//倾听者
TttsOnInitListener = class(TJavaLocal, JTextToSpeech_OnInitListener)
private
FParent: TForm1;
public
constructor Create(AParent: TForm1);
procedure onInit(status: Integer); cdecl;
end;
private
{ Private declarations }
ttsListener: TttsOnInitListener;//倾听者私有对象
TTS: JTextToSpeech;//文字TO言语
procedure SpeakOut;//说话
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end; var
Form1: TForm1; implementation {$R *.fmx}
{$R *.LgXhdpiPh.fmx ANDROID}
//发音
procedure TForm1.Button1Click(Sender: TObject);
begin
SpeakOut;
end;
//初始化
procedure TForm1.Button2Click(Sender: TObject);
begin
TTS := TJTextToSpeech.JavaClass.init(SharedActivityContext, ttsListener);
end;
//建立私有对象
constructor TForm1.Create(AOwner: TComponent);
begin
inherited;
ttsListener := TttsOnInitListener.Create(self);
end;
//释放对象
destructor TForm1.Destroy;
begin
if Assigned(TTS) then
begin
TTS.stop;
TTS.shutdown;
TTS := nil;
end;
ttsListener := nil;
inherited;
end;
//把要朗读的文字指定给 TTS 引擎
procedure TForm1.SpeakOut;
var
text: JString;
begin
text := StringToJString(Memo1.Lines.text);
TTS.speak(text, TJTextToSpeech.JavaClass.QUEUE_FLUSH, nil);
end; { TForm1.TttsOnInitListener } constructor TForm1.TttsOnInitListener.Create(AParent: TForm1);
begin
inherited Create;
FParent := AParent;
end; procedure TForm1.TttsOnInitListener.onInit(status: Integer);
var
Result: Integer;
begin
if (status = TJTextToSpeech.JavaClass.SUCCESS) then
begin
Result := FParent.TTS.setLanguage(TJLocale.JavaClass.US); // 这是指定这美语
if (Result = TJTextToSpeech.JavaClass.LANG_MISSING_DATA) or
(Result = TJTextToSpeech.JavaClass.LANG_NOT_SUPPORTED) then
//这里在XE10.1中提示“只能在主线程中使用此提示”
//ShowMessage('不支持这种语言!')
else
begin
FParent.Button1.Enabled := True;
FParent.Button2.Enabled := False;
end;
end
else
begin
//ShowMessage('初始化失败!');
end;
end; end.
调用GOOGLE的TTS实现文字转语音(XE7+小米2)(XE10.1+小米5)的更多相关文章
- Android实例-调用GOOGLE的TTS实现文字转语音(XE7+小米2)(无图)
注意:在手机上必须选安装文字转语音引擎“google Text To Speech”地址:http://www.shouji56.com/soft/GoogleWenZiZhuanYuYinYinQi ...
- Android实例-调用GOOGLE的TTS实现文字转语音(XE7+小米2)(XE10.1+小米5)
相关资料: 注意:在手机上必须选安装文字转语音引擎“google Text To Speech”地址:http://www.shouji56.com/soft/GoogleWenZiZhuanYuYi ...
- Android文字转语音引擎(TTS)使用
百度网盘下载地址 密码:3si0资源来源:https://blog.csdn.net/Sqq_yj/article/details/82460580?utm_source=blogxgwz4 简单比较 ...
- Android技术分享-文字转语音并朗读
Android技术分享-文字转语音并朗读 最近在做一个项目,其中有一个功能是需要将文本转换成语音并播放出来.下面我将我的做法分享一下. 非常令人开心的是,Android系统目前已经集成了TTS,提供了 ...
- speech sdk 文字转语音
1.下载SDK包 https://www.microsoft.com/en-us/download/details.aspx?id=10121 2.直接上代码 // SpeechRecognition ...
- Delphi文字转语音TTS【支持选择语音库,播放,暂停,开始,停止,生成语音文件,设置音量,设置语速】
作者QQ:(648437169) 点击下载➨文字转语音TTS [Delphi 文字转语音TTS]调用系统自带的TTS组件,支持XP,vista,win7,win8,win10系统,支持选择语音库,播放 ...
- 160617、使用espeak将文字转语音(TTS)
http://www.eguidedog.net/cn/WebSpeech_cn.php 简单使用例子: <html> <head> <meta http-equiv=& ...
- 【转】调用百度API,HTML在线文字转语音播报
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- TTS 文字转语音 ekho
1.源码下载 使用svn客户端,执行如下命令下载 svn co https://svn.code.sf.net/p/e-guidedog/code/ 2.官方网站查看说明 http://www.egu ...
随机推荐
- dell E6400笔记本 centos7 安装无线网卡
1.下载 驱动:http://download.csdn.net/detail/nj4506/9752842 2.解压: make make install 3.将wk.ko拷贝到 /lib/mo ...
- Qt5+VS2010的安装及使用
在我的博客<Win7下Qt5的安装及使用>中讲解了win7下Qt5+MinGW的安装及使用,本节再讲解win7下Qt5+VS2010的安装及使用.利用Qt5+MinGW开发应用程序比较麻烦 ...
- Maximum Average Subarray II LT644
Given an array consisting of n integers, find the contiguous subarray whose length is greater than o ...
- 使用flask-alchemy 过程中报错KeyError: 'SQLALCHEMY_TRACK_MODIFICATIONS'
在网上找了很多, 大多数说是必须要给 SQLALCHEMY_TRACK_MODIFICATIONS 一个默认值,尝试修改alchemy 源码,,但是还是不起作用 最后阅读源码 , self.app = ...
- Hibernate学习笔记:基础模型类
根据业务建模型时,有一些字段基本每个表都是需要的,如下表: package com.company.jelly.model; import javax.persistence.EntityListen ...
- JS Async Callback
AsyncCallback 意义: 异步操作完成时调用的方法 语法1: 构造异步回调对象 AsyncCallback 异步回调对象名asyncCallback = new AsyncCallback( ...
- 组合数问题(NOIP2016)
题目链接:组合数问题 这道题可以算当年第二简单的. 这里要用到两个技巧: 用杨辉三角递推计算组合数 运用前缀和 有了这两点,这道题就出来了. 我们先运用杨辉三角推出题目范围内所能用到的所有组合数,然后 ...
- java web 大总结
C/s架构: socket.serversocket.awt/swing做一个客户端软件 建好socket连接后,通过IO流交换数据.数据格式由各个开发者自己确定,B/C架 ...
- 2019.01.03 bzoj3456: 城市规划(生成函数+多项式取对)
传送门 生成函数好题. 题意:求n个点的简单(无重边无自环)无向连通图数目 思路: 对简单无向图构造生成函数f(x)=∑n2Cn2xnn!f(x)=\sum_n2^{C_n^2}\frac{x^n}{ ...
- 2018.11.17 hdu5829Rikka with Subset(ntt)
传送门 nttnttntt基础题. 考虑计算每一个数在排名为kkk时被统计了多少次来更新答案. 这样的话,设anskans_kansk表示所有数的值乘上排名为kkk的子集数的总和. 则ansk=∑i ...