Web Audio Api Record音频节点 [英] Web Audio Api Record audio node

查看:77
本文介绍了Web Audio Api Record音频节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以用trackPosition,offset以某种方式记录并输出到WAV.当在浏览器中播放时,它工作正常,我只想将输出输出到WAV文件.

Can I somehow record and output to WAV with trackPosition, offset. it works fine when played in browser works fine I just wanna output is to WAV file.

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,听起来像您要找的东西!

Check out https://github.com/mattdiamond/Recorderjs - it let's you record/save the output of your Web Audio app as a .wav, which sound like what you're looking for!

这篇关于Web Audio Api Record音频节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆