我正在尝试添加录音机在我的应用程序,但面临太多的问题,因为我是新的反应本机,请指导我有什么好的录音软件包。
谢谢你。
发布于 2021-11-22 12:33:25
您可以对此link使用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 (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
});https://stackoverflow.com/questions/70065584
复制相似问题