Skip to content

WhojamLab/WAARecorderNode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WAARecorderNode

WAARecorderNode is a simple, lightweight Web Audio API recorder node, with precise scheduling methods. It gives you perfect control over when your recording starts and stops, therefore allowing perfect synchronization with the rest of the audio graph.

To use, first grab the latest build here and add it to your web page.

Then to record some audio do ...

  1. Create a WAARecorderNode, and connect the source you want to record from. Any Web Audio API AudioNode will work.
var recorderNode = new WAARecorderNode(audioContext)
recorderNode.recordFrom(audioNode)
  1. Start the recording at a given time in the future, using for time reference AudioContext.currentTime.
// start the recording in exactly one second from now, record a duration of maximum 15 seconds
recorderNode.record(audioContext.currentTime + 1, 15)

or

// start the recording at audioContext.currentTime == 10
recorderNode.record(10, 15)
  1. Add a callback to handle your recording when it will be complete
recorderNode.onended = function() {
  // getAudioBuffer returns the full recording as a Web Audio API AudioBuffer
  var myRecording = recorderNode.getAudioBuffer()
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published