gpt4 book ai didi

audio - Web Audio Api Record音频节点

转载 作者:行者123 更新时间:2023-12-02 23:43:21 27 4
gpt4 key购买 nike

我可以用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-它使您可以将Web Audio应用程序的输出记录/保存为.wav,听起来像您要找的东西!

关于audio - Web Audio Api Record音频节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35207996/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com