
修改bitcode为no
1,运行官方demo初始化报错
Get offline TTS license from server failed

解决:
在百度ai开放平台的控制台新建应用时,iOS包名填写为工程的Bundle id
https://console.bce.baidu.com/ai/?_=1639722204766&fromai=1#/ai/speech/app/list
将demo中apikey、secret key换成自己新建应用的key:

appcode换为自己创建的应用的appid:

初始化报错BDTTSErrDomainEmbeddedTTS:Baidu voice speaker resource authorization failed

解决:
将resource文件夹删掉

将demo目录里的BDSClientResource文件夹放入工程中

后面改了boundle id再运行又报这个错,,折腾半天,把这两个交换一下,可以了..不知道是不是什么时候不小心弄反了

2,语音识别报错

解决:
和百度技术人员沟通了好多次都说是因为手机网络问题,但是手机网络是正常的。后来忽然想到公司提供的libBaiduSpeechSDK.a库有依赖加密的三个库,可能是因为加密库导致的网络异常,然后联系公司技术人员换了移除加密库后的libBaiduSpeechSDK.a,再运行不会报错了。。
3,自己写的demo,头文件、库都添加之后,编译成功,但是调用BDSSpeechSynthesizer单例会报错

解决:(不确定是不是加错了库,可能把语音识别里的.a放进来,但是调用的是语音合成的方法,报了这个错)
删掉重新拖入语音合成的libBaiduSpeechSDK.a之后build报sqlite的错误了
另:如果同时集成语音合成和 语音识别,两个demo中的libBaiduSpeechSDK.a不要同时拖进项目,将其中一个改一下名字再试试(网上搜到的方法,遇到的时候试一下)
报错sqlite相关

解决:添加libsqlite3.0.tbd

报错:(坑真多,官方文档为什么不说明要加这些库...)

解决:
添加Accelerate.framework

使用识别ui类BDRecognizerViewController时,报错

解决:
在点击语音识别按钮时执行了[self.asrManager sendCommand:BDS_ASR_CMD_START];
也执行了[self.recognizerViewController startVoiceRecognition];
语音识别的时候报错server read sdk error, not ltv struct
解决:
网上没搜到有用的解决方法。
识别的时候我一直说的都是“百度语音”,识别一直报错,但是当我换成“你好”,识别就成功了...
received down http, without up http
这个问题好像也是因为这个
集成到项目中,语音识别的时候
xxxApp(app name) was compiled with optimization - stepping may behave oddly; variables may not be available.
解决:
网友评论