Skip to content

Commit

Permalink
Merge pull request #71 from Nitnelav/random-audio-annotation
Browse files Browse the repository at this point in the history
Random audio annotation
  • Loading branch information
Nitnelav authored Dec 12, 2024
2 parents ea5ac1d + 58daf6a commit 401624c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,22 @@ ws.once('interaction', () => {
})

// Create Web Audio context
const audioContext = new AudioContext()
const audioContext = null

var gainNode = null

// Connect the audio to the equalizer
ws.media.addEventListener(
'canplay',
() => {
if (audioContext == null) {
audioContext = new AudioContext()
}
// Create a MediaElementSourceNode from the audio element
const mediaNode = audioContext.createMediaElementSource(ws.media)

gainNode = audioContext.createGain();
gainNode.gain.value = 100 * ws.media.volume;
gainNode = audioContext.createGain();
gainNode.gain.value = 100 * ws.media.volume;
mediaNode.connect(gainNode);
// Connect the filters to the audio output
gainNode.connect(audioContext.destination)
Expand Down

0 comments on commit 401624c

Please sign in to comment.