简体   繁体   English

带有 React Native 的录音机

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

相关问题 反应原生录音机不会停止 - react-native audio recorder not stopping stopRecorder() 不工作 - react-native-audio-recorder-player - stopRecorder() is not working - react-native-audio-recorder-player 想要显示使用 react-native-audio-recorder-player 录制的音频的秒数 - want to show the number of the seconds of audio recorded by using react-native-audio-recorder-player 使用 react-native-audio-recorder-player 和 RNFetchBlob 无法在 iOS 上播放远程音频 - Play remote audio with react-native-audio-recorder-player and RNFetchBlob not working on iOS react-native-audio-recorder-player 错误 未找到 ID 为“kotlin-android”的插件。 compileSdkVersion 未指定 - react-native-audio-recorder-player error Plugin with id "kotlin-android" not found. compileSdkVersion is not specified react-native-audio-recorder-player:无法读取未定义的属性“startRecorder” - react-native-audio-recorder-player: Cannot read property 'startRecorder' of undefined 在 react-native-audio-recorder-player 中播放 base64 字符串 - Play from base64 string in react-native-audio-recorder-player 配置项目时出现问题':react-native-audio-recorder-player'>compileSdkVersion is not specified,while running react-native run-android - A problem occurred configuring project':react-native-audio-recorder-player' >compileSdkVersion is not specified,while running react-native run-android 如何在React Native中使用Espresso Test Recorder - How to use Espresso Test Recorder in React Native 反应本机音频可视化 - React Native Audio Visualization
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM