siboEnglish音频修改问题总结文档

1.替换原read.js文件和proguard-rules.pro文件

2.将audio文件夹放到reactasome目录下

android/src/main/java/com/reactasome/audio

3.在MainApplication.java中加入

import com.siboEnglish.audio.RecognizerPackage;

packages.add(new RecognizerPackage());

4.修改 app/build.gradle

def enableProguardInReleaseBuilds = false

5.在android/build.gradle中两个repositories首行加入:

mavenCentral()

6.在viewpager.js加入权限申请

UNSAFE_componentWillMount() {
	PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE).then(res => {  })
	PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.RECORD_AUDIO).then(res => { })
}

7.安装第三方库react-native-ffmpeg

yarn add react-native-ffmpeg

如果项目启动时该库报错,修改该库中build.gradle,在repositories中加入:
maven { url ‘https://maven.aliyun.com/repository/google’ }
maven { url ‘https://maven.aliyun.com/repository/jcenter’ }

上一篇:RK audio 拨号同时输出Speaker和USB音频


下一篇:音视频之音频(三)