2016-02-04 130 views
1

我能以某種方式記錄並輸出到帶有trackPosition偏移量的WAV。它在瀏覽器中正常播放時工作正常我只是想輸出到WAV文件。網絡音頻Api記錄音頻節點

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; 
} 
+0

我應該如何使用recorderjs這個功能? node.start( currentTime + trackPosition - 光標, 偏移量, 持續時間 ); 你能給我解釋一些代碼嗎? – user1087179

回答