3 Star 0 Fork 2

Gitee 极速下载 / react-native-baidu-vtts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/wayne214/react-native-baidu-vtts.git
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

react-native-baidu-vtts

This is an React-native library that can do text-to-speech

Before

please follow this page ReactNative集成百度语音合成 make setting.

notice

current is only support android, ios coming soon.

Getting started

$ npm install react-native-baidu-vtts --save

Mostly automatic installation

$ react-native link react-native-baidu-vtts

Manual installation

iOS

coming soon

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.wayne.baiduvoice.RNBaiduvoicePackage; to the imports at the top of the file
  • Add new RNBaiduvoicePackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-baidu-vtts'
    project(':react-native-baidu-vtts').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-baidu-vtts/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
    implementation project(':react-native-baidu-vtts')

Usage

import RNBaiduvoice from 'react-native-baidu-vtts';

// TODO: What to do with the module?
class App extends Component{

    componentDidMount() {
    	// 填写百度语音官网申请的appid, apikey, secretkey
    	const appid = ''
    	const apikey = ''
    	const secretkey = ''
        RNBaiduvoice.initBaiduTTS(appid,apikey,secretkey)
    }

    _speechText = () => {
        RNBaiduvoice.speak('百度语音')
    }

    render() {
        return (
            <View style={styles.container}>
                {/*<TwoList/>*/}
                <TouchableOpacity onPress={this._speechText}>
                    <Text style={{fontSize: 20, height: 30}}>测试语音</Text>
                </TouchableOpacity>
            </View>
        );
    }
}

空文件

简介

ReactNative集成百度语音合成功能,解决部分安卓手机因系统取消tts模块导致无法进行文字转语音功能 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/mirrors/react-native-baidu-vtts.git
git@gitee.com:mirrors/react-native-baidu-vtts.git
mirrors
react-native-baidu-vtts
react-native-baidu-vtts
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891