Web Audio Api 录制音频节点
Web Audio Api Record audio node
我能以某种方式使用 trackPosition、offset 录制并输出到 WAV 吗?在浏览器中播放时效果很好我只想输出到 WAV 文件。
for (var i = 0; i <= loop; ++i) {
node = that.context.createBufferSource();
that.nodes.push(node);
node.buffer = clip.get('buffer');
node.connect(gainNode);
// clip offset and duration times
if (loop > 0) {
if (i === 0) { // first subclip
offset = startTime;
duration = duration - offset;
} else if (i === loop) { // last subclip
offset = 0;
duration = endTime;
} else {
offset = 0;
duration = clip.get('buffer').duration;
}
} else { // loop === 0
offset = startTime;
if (inClipStart)
duration = endTime - startTime;
else
duration = clip.clipLength();
}
// sets the clip's playback start time
node.start(
currentTime + trackPosition - cursor,
offset,
duration
);
trackPosition += duration;
}
查看 https://github.com/mattdiamond/Recorderjs - 它让您 record/save 将网络音频应用程序的输出作为 .wav,这听起来就像您正在寻找的一样!
我能以某种方式使用 trackPosition、offset 录制并输出到 WAV 吗?在浏览器中播放时效果很好我只想输出到 WAV 文件。
for (var i = 0; i <= loop; ++i) {
node = that.context.createBufferSource();
that.nodes.push(node);
node.buffer = clip.get('buffer');
node.connect(gainNode);
// clip offset and duration times
if (loop > 0) {
if (i === 0) { // first subclip
offset = startTime;
duration = duration - offset;
} else if (i === loop) { // last subclip
offset = 0;
duration = endTime;
} else {
offset = 0;
duration = clip.get('buffer').duration;
}
} else { // loop === 0
offset = startTime;
if (inClipStart)
duration = endTime - startTime;
else
duration = clip.clipLength();
}
// sets the clip's playback start time
node.start(
currentTime + trackPosition - cursor,
offset,
duration
);
trackPosition += duration;
}
查看 https://github.com/mattdiamond/Recorderjs - 它让您 record/save 将网络音频应用程序的输出作为 .wav,这听起来就像您正在寻找的一样!