[英]Audio recorder with React Native
I am trying to add audio recorder in my app but facing too many issues because I am new in React Native please guide me about any good package for audio recording.我正在尝试在我的应用程序中添加录音机,但面临太多问题,因为我是 React Native 的新手,请指导我任何好的 package 用于录音。
Thank you.谢谢你。
you can use react-native-audio-record
with this link您可以通过此链接使用
react-native-audio-record
for sample code can see this:示例代码可以看到这个:
import AudioRecord from 'react-native-audio-record';
const options = {
sampleRate: 16000, // default 44100
channels: 1, // 1 or 2, default 1
bitsPerSample: 16, // 8 or 16, default 16
audioSource: 6, // android only (see below)
wavFile: 'test.wav' // default 'audio.wav'
};
AudioRecord.init(options);
AudioRecord.start();
AudioRecord.stop();
// or to get the wav file path
audioFile = await AudioRecord.stop();
AudioRecord.on('data', data => {
// base64-encoded audio data chunks
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.