语音合成错误 speak()错误
ID为啥不能重复 发布于2018-02 浏览:4672 回复:11
0
收藏

调用mSpeechSynthesizer.speak(text)出现错误,日志如下:

02-02 16:11:55.608 19179-19218/com.sete E/ExternalDisplayActivity: 调用百度语音
02-02 16:11:55.628 19179-19218/com.sete D/bdtts-NameThreadFactory: threadName=SpeechSynthesizerPoolThread(1)
02-02 16:11:55.628 19179-19218/com.sete I/ExternalDisplayActivity: 合成并播放 按钮已经点击
02-02 16:11:55.628 19179-19249/com.sete D/bdtts-ArgsCheckInterceptor: text=百度语音测试
02-02 16:11:55.628 19179-19249/com.sete D/bdtts-StatisticsInterceptor: statistics
02-02 16:11:55.638 19179-19249/com.sete D/bdtts-NameThreadFactory: threadName=EngineExecutorPoolThread(1)
02-02 16:11:55.648 19179-19249/com.sete D/bdtts-AInterceptorHandler: afterResult=0
02-02 16:11:55.648 19179-19250/com.sete I/MessageListener: 准备开始合成,序列号:0
02-02 16:11:55.648 19179-19250/com.sete D/bdtts-NameThreadFactory: threadName=PlayExecutorPoolThread(1)
02-02 16:11:55.648 19179-19250/com.sete D/bdtts-SpeechDecoder: before load gnustl_shared
02-02 16:11:55.648 19179-19251/com.sete D/bdtts-PlayQueueMachine: enter run
02-02 16:11:55.648 19179-19250/com.sete D/dalvikvm: Trying to load lib /data/app-lib/com.sete-2/libgnustl_shared.so 0x444e5108
02-02 16:11:55.648 19179-19251/com.sete D/bdtts-AudioTrackPlayer: enter put
02-02 16:11:55.648 19179-19251/com.sete I/MessageListener: 播放开始回调, 序列号:0
02-02 16:11:55.648 19179-19251/com.sete D/bdtts-AudioTrackPlayer: end put
02-02 16:11:55.648 19179-19251/com.sete D/bdtts-PlayQueueMachine: end run
02-02 16:11:55.658 19179-19250/com.sete D/dalvikvm: Added shared lib /data/app-lib/com.sete-2/libgnustl_shared.so 0x444e5108
02-02 16:11:55.658 19179-19250/com.sete D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com.sete-2/libgnustl_shared.so 0x444e5108, skipping init
02-02 16:11:55.658 19179-19250/com.sete D/bdtts-SpeechDecoder: before load BDSpeechDecoder_V1
02-02 16:11:55.658 19179-19250/com.sete D/dalvikvm: Trying to load lib /data/app-lib/com.sete-2/libBDSpeechDecoder_V1.so 0x444e5108
02-02 16:11:55.658 19179-19250/com.sete D/dalvikvm: Added shared lib /data/app-lib/com.sete-2/libBDSpeechDecoder_V1.so 0x444e5108
02-02 16:11:55.658 19179-19250/com.sete D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com.sete-2/libBDSpeechDecoder_V1.so 0x444e5108, skipping init
02-02 16:11:55.658 19179-19250/com.sete D/bdtts-SpeechDecoder: after load BDSpeechDecoder_V1
02-02 16:11:55.658 19179-19250/com.sete D/bdtts-OnlineSynthesizer: count=1
02-02 16:11:55.668 19179-19252/com.sete D/bdtts-Device: read deviceID:A3F12CB8CD1944DE95FD6798447DD7A4|0
02-02 16:11:55.668 19179-19252/com.sete D/bdtts-OnlineSynthesizer: before online auth
02-02 16:11:55.668 19179-19254/com.sete D/bdtts-AuthClient: pid=null
02-02 16:11:55.668 19179-19254/com.sete D/bdtts-AuthClient: ak=OwZjFafO1roTToiiWBkWNWMa
02-02 16:11:55.668 19179-19254/com.sete D/bdtts-AuthClient: sk=iXjGjo88fmFGafjXgwHKyLviIq3AgflF
02-02 16:11:55.668 19179-19254/com.sete D/bdtts-Memorizer: + run f=java.util.concurrent.FutureTask@44766570
02-02 16:11:55.668 19179-19254/com.sete D/bdtts-OnlineAuth: enter online auth
02-02 16:11:55.678 19179-19254/com.sete D/bdtts-OnlineAuth: url=https://openapi.baidu.com/oauth/2.0/token?grant_type=client_credentials&client_id=OwZjFafO1roTToiiWBkWNWMa&client_secret=iXjGjo88fmFGafjXgwHKyLviIq3AgflF
02-02 16:11:55.698 19179-19254/com.sete W/AsyncHttpRH: Current thread has not called Looper.prepare(). Forcing synchronous mode.
02-02 16:11:55.888 19179-19254/com.sete W/ResponseProcessCookies: Invalid cookie header: "Set-Cookie: BAIDUID=169C30D4596B43ED8837BA1268B1129F:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2145916555; path=/; domain=.baidu.com; version=1". Unable to parse expires attribute: Thu
02-02 16:11:55.888 19179-19254/com.sete V/AsyncHttpRH: Progress 654 from 482 (136%)
02-02 16:11:55.898 19179-19254/com.sete D/bdtts-OnlineAuth: body={"access_token":"24.cca42287c63d6b81d345b3a941e3d7a1.2592000.1520151110.282335-10678807","session_key":"9mzdWBPzknse3XYcls4DkXsYTUPjG8l8cpie1MVVFoInLP5qYSKlMeJMMkrAONkWu\/V8p+9Ad3Ivk8MgleyTuW6ZGhVJKg==","scope":"public brain_all_scope audio_voice_assistant_get audio_tts_post wise_adapt lebo_resource_base lightservice_public hetu_basic lightcms_map_poi kaidian_kaidian ApsMisTest_Test\u6743\u9650 vis-classify_flower bnstest_fasf lpq_\u5f00\u653e cop_helloScope ApsMis_fangdi_permission","refresh_token":"25.d7f27d0bb58a1f4ec58795ff9c97f3e9.315360000.1832919110.282335-10678807","session_secret":"83f2856a2d926b2a1c9109cd7db079e1","expires_in":2592000}
--code=200
02-02 16:11:55.898 19179-19254/com.sete D/bdtts-OnlineAuth: end online auth
02-02 16:11:55.898 19179-19254/com.sete D/bdtts-Memorizer: - run f=java.util.concurrent.FutureTask@44766570
02-02 16:11:55.898 19179-19252/com.sete D/bdtts-OnlineSynthesizer: after online auth
02-02 16:11:55.898 19179-19252/com.sete D/bdtts-OnlineSynthesizer: request params: idx=1,sn=2926e7b8-16a6-4392-ba1e-1c5f94b67820,platform=Android,ver=V2.3.1,tex=%E7%99%BE%E5%BA%A6%E8%AF%AD%E9%9F%B3%E6%B5%8B%E8%AF%95,ctp=10,cuid=A3F12CB8CD1944DE95FD6798447DD7A4|0,tok=24.cca42287c63d6b81d345b3a941e3d7a1.2592000.1520151110.282335-10678807,cod=2,aue=1,rate=4,per=0,num=null,en=null,sty=null,bcg=null,ter=null,puc=null,lan=ZH,spd=5,pit=5,vol=9,xml=0,
02-02 16:11:55.908 19179-19252/com.sete D/bdtts-OnlineSynthesizer: timeout=6000
02-02 16:11:55.908 19179-19252/com.sete W/AsyncHttpRH: Current thread has not called Looper.prepare(). Forcing synchronous mode.
02-02 16:11:55.908 19179-19252/com.sete D/bdtts-OnlineSynthesizer: serverIp=https://220.181.112.83/text2audio
02-02 16:11:55.918 19179-19252/com.sete D/bdtts-OnlineSynthesizer: before post
02-02 16:11:56.228 19179-19252/com.sete W/ResponseProcessCookies: Invalid cookie header: "Set-Cookie: BAIDUID=215B72842CAEEE8F3AFA123FE5C7BAD0:FG=1; expires=Sat, 02-Feb-19 08:11:50 GMT; max-age=31536000; path=/; domain=.baidu.com; version=1". Unable to parse expires attribute: Sat
02-02 16:11:56.228 19179-19252/com.sete D/bdtts-TtsResponseHandler: parseJSON errNo=0
02-02 16:11:56.238 19179-19252/com.sete D/bdtts-OnlineSynthesizer: after post
02-02 16:11:56.248 19179-19250/com.sete D/bdtts-OnlineSynthesizer: mindex=1 progress=0
02-02 16:11:56.318 19179-19250/com.sete E/MessageListener: 错误发生:(-10)online engine call synthesize exception[(cause)java.lang.reflect.UndeclaredThrowableException],错误编码:-10,序列号:0

收藏
点赞
0
个赞
共11条回复 最后由用户已被禁言回复于2022-04
#12用户已被禁言回复于2019-11
#11 g2link2019回复
是和自有项目中其它库的abi冲突了

怎么解决的呢?更改了名称吗?

0
#11g2link2019回复于2019-11
#10 用户已被禁言回复
可以看一下SDK里的图文教程。

是和自有项目中其它库的abi冲突了

0
#10用户已被禁言回复于2019-11
#9 用户已被禁言回复
armeabi,armeabi-v7a,arm64-v8a,x86,x86_64,每个架构下均有5个so库文件。https://ai.baidu.com/docs/#/ASR-Android-SDK/f71f36c9
展开

可以看一下SDK里的图文教程。

0
#9用户已被禁言回复于2019-11
#8 g2link2019回复
我也遇到了,反编译apk发现貌似是abi冲突导致的,项目中只添加了armeabi,可apk中生成了arm64-v8a目录,但是里面没有对应的so库 通过设置纯在线模式, 并且设置不压缩,彻底不使用so文件,这样可以播了。 TtsMode.ONLINE params.put(SpeechSynthesizer.PARAM_AUDIO_ENCODE, SpeechSynthesizer.AUDIO_ENCODE_PCM); params.put(SpeechSynthesizer.PARAM_AUDIO_RATE, SpeechSynthesizer.AUDIO_BITRATE_PCM);
展开

armeabi,armeabi-v7a,arm64-v8a,x86,x86_64,每个架构下均有5个so库文件。https://ai.baidu.com/docs/#/ASR-Android-SDK/f71f36c9

0
#8g2link2019回复于2019-11

我也遇到了,反编译apk发现貌似是abi冲突导致的,项目中只添加了armeabi,可apk中生成了arm64-v8a目录,但是里面没有对应的so库

通过设置纯在线模式, 并且设置不压缩,彻底不使用so文件,这样可以播了。

TtsMode.ONLINE

params.put(SpeechSynthesizer.PARAM_AUDIO_ENCODE, SpeechSynthesizer.AUDIO_ENCODE_PCM);
params.put(SpeechSynthesizer.PARAM_AUDIO_RATE, SpeechSynthesizer.AUDIO_BITRATE_PCM);

0
#7用户已被禁言回复于2019-09
#6 天涯过客1027回复
这个问题解决了吗,我也遇到一样的,demo可以用,把代码弄到项目就不行
展开

demo没有问题,请不要修改代码,按图文集成到项目中。

0
#6天涯过客1027回复于2019-09
#5 ID为啥不能重复回复
一个handler没有复制过来~~~

这个问题解决了吗,我也遇到一样的,demo可以用,把代码弄到项目就不行

0
#5ID为啥不能重复回复于2018-02

一个handler没有复制过来~~~

0
#4ID为啥不能重复回复于2018-02

日志里看不出什么吗?比如参数传错了之类的?

0
#3ID为啥不能重复回复于2018-02

demo可以用的啊 ~  我的miniactivity的代码 原封不动拷过来  就不行了~  是不是我的应用有问题啊? 我账号建了3个语音合成的应用  和这个有关系吗? 想删也删不掉

0
#2fujiayi1984回复于2018-02

请测试下官方demo

0
TOP
切换版块