As you already know that there is no inbuilt feature to record audio in React Native, However you can always use third part Library/package.
(您已经知道没有内置功能可以在React Native中录制音频,但是您始终可以使用第三方库/包。)
There are number of them available on NPM.(NPM上有许多可用的。)
Here is one of them react native audio record(这是其中之一对本地音频记录的反应)
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 wavFile: 'test.wav' // default 'audio.wav' }; AudioRecord.init(options); //Start Recording AudioRecord.start(); //Stop Recording AudioRecord.stop();
Hope this help
(希望这个帮助)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…