类 SpeechSynthesizer
java.lang.Object
com.tencent.tts.service.SpeechSynthesizer
public class SpeechSynthesizer
extends java.lang.Object
-
构造器概要
构造器 构造器 说明 SpeechSynthesizer(SpeechSynthesisConfig speechSynthesisConfig, SpeechSynthesisRequest speechSynthesisRequest, SpeechSynthesisListener eventListener)初始化 -
方法概要
修饰符和类型 方法 说明 voidinitClient()initClient 初始化clientbyte[]read(java.io.InputStream inputStream, org.apache.http.client.methods.CloseableHttpResponse response)protected static byte[]readChunkData(java.io.InputStream in)byte[]readStream(java.io.InputStream inputStream, org.apache.http.client.methods.CloseableHttpResponse response)读取chunked数据 pcmSpeechSynthesizersynthesis(java.lang.String texts)执行tts请求SpeechSynthesizersynthesisLongText(java.lang.String texts)长文本合成
-
构造器详细资料
-
SpeechSynthesizer
public SpeechSynthesizer(SpeechSynthesisConfig speechSynthesisConfig, SpeechSynthesisRequest speechSynthesisRequest, SpeechSynthesisListener eventListener)初始化- 参数:
speechSynthesisConfig- 配置speechSynthesisRequest- 请求参数eventListener- 结果回调函数
-
-
方法详细资料
-
initClient
public void initClient()initClient 初始化client -
synthesis
执行tts请求- 参数:
texts- 文本- 返回:
- SpeechSynthesizer
-
synthesisLongText
长文本合成- 参数:
texts- 文本- 返回:
- SpeechSynthesizer
-
read
public byte[] read(java.io.InputStream inputStream, org.apache.http.client.methods.CloseableHttpResponse response) -
readStream
public byte[] readStream(java.io.InputStream inputStream, org.apache.http.client.methods.CloseableHttpResponse response)读取chunked数据 pcm- 参数:
inputStream- inputStream- 返回:
- byte[]
-
readChunkData
protected static byte[] readChunkData(java.io.InputStream in) throws java.io.IOException- 抛出:
java.io.IOException
-