We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
已经设置了sourceStream为什么导出的时候倒是单声道音频还需要额外处理什么吗 let recorderNew: any = null; export const recordStartNew = () => { navigator.mediaDevices .getUserMedia({ audio: { channelCount: 2, }, }) .then((stream) => { const audioContext = new window.AudioContext(); const source = audioContext.createMediaStreamSource(stream); // 创建双声道处理 const channelMerger = audioContext.createChannelMerger(2); source.connect(channelMerger); channelMerger.connect(audioContext.destination); recorderNew = RecorderNew({ type: "wav", // 录音格式,可以换成wav等其他格式 sampleRate: 48000, // 录音的采样率,越大细节越丰富越细腻 bitRate: 16, // 录音的比特率,越大音质越好 sourceStream: stream, }); recorderNew.open(() => { recorderNew.start(); }); // 成功回调,返回媒体流 }) .catch((error) => { // 错误处理 }); };
The text was updated successfully, but these errors were encountered:
Recorder只支持单声道,没有支持双声道,双声道的stream也只会录到单个声道
Sorry, something went wrong.
No branches or pull requests
已经设置了sourceStream为什么导出的时候倒是单声道音频还需要额外处理什么吗
let recorderNew: any = null;
export const recordStartNew = () => {
navigator.mediaDevices
.getUserMedia({
audio: {
channelCount: 2,
},
})
.then((stream) => {
const audioContext = new window.AudioContext();
const source = audioContext.createMediaStreamSource(stream);
// 创建双声道处理
const channelMerger = audioContext.createChannelMerger(2);
source.connect(channelMerger);
channelMerger.connect(audioContext.destination);
recorderNew = RecorderNew({
type: "wav", // 录音格式,可以换成wav等其他格式
sampleRate: 48000, // 录音的采样率,越大细节越丰富越细腻
bitRate: 16, // 录音的比特率,越大音质越好
sourceStream: stream,
});
recorderNew.open(() => {
recorderNew.start();
});
// 成功回调,返回媒体流
})
.catch((error) => {
// 错误处理
});
};
The text was updated successfully, but these errors were encountered: