[英]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.