[英]Play remote audio with react-native-audio-recorder-player and RNFetchBlob not working on iOS
[英]react-native-audio-recorder-player: Cannot read property 'startRecorder' of undefined
我的代码在 android 平台上运行良好,但在 ios 中我得到: unhandled Promise Rejection: Cannot read property 'startRecorder' of undefined
错误的unhandled Promise Rejection: Cannot read property 'startRecorder' of undefined
我正在寻找一个用于 react-native 的录音机包,这个包似乎是最好的解决方案,但它在 ios 平台上不起作用
const audioRecorderPlayer = new AudioRecorderPlayer();
class QuestionSection extends Component {
async onRecordPressed() {
if (await this.requestPermissions()) {
console.warn('start');
await audioRecorderPlayer.startRecorder();
}
}
在构造函数中添加这些行并享受
this.audioRecorderPlayer = new AudioRecorderPlayer();
this.audioRecorderPlayer.setSubscriptionDuration(0.09);
在钩子中使用在 UseEffect 中添加这些行
audioRecorderPlayer = new AudioRecorderPlayer();
audioRecorderPlayer.setSubscriptionDuration(0.09);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.