---
title: "基于cordova的 百度混音插件 iOS版"
author: "zero1111"
date: "2015-08-30T20:46:49Z"
tags: []
categories: ["移动开发"]
slug: "cordova-ios"
draft: false
lastmod: "2015-08-30T20:48:27Z"
id: 2239433
url: "https://zero1111.iteye.com/blog/2239433"
---

功能:实现将文字转换成声音的cordova插件：
地址：
https://github.com/paulwangtao/cordova-plugins-BaiduSpeech
1.基于:Cordova 集成 百度语音

百度语音的下载地址是：http://yuyin.baidu.com/pz.html

sdk和License 需要自行下载

2.注意事项 加入build报找不到类库libbdtts.a 需要设定 “Other Linker Flags” under "Build Setting” 加入-lstdc++ Capablities — in AppAudio 打开

3.命令行 ionic plugin add /Users/wangtao/Developer/Cordova-plugin-Audio/cordova.plugins.BaiduSpeech

4.修改BaiduAudioConfig.plist 的三个属性，这个是在百度语音申请的ID，也可以参照百度混音的api
App_ID xxxxx API_Key xxxxx Secret_Key xxxxx

5.调用 //初始化 cordova.plugins.BaiduSpeech.init({person:"female"}); //发出声音 cordova.plugins.BaiduSpeech.speech(msg.value);