Skip to content

Need help with detecting loudness with wavesurfer lib (React) #3807

Answered by katspaugh
WickyPlays asked this question in Q&A
Discussion options

You must be logged in to vote

Try debugging it. Check how many times your effects run and with what values in the variables.

From what I can spot, the problem might be that you're creating another buffer source with the same buffer.

    const source = audioContext.createBufferSource();
    source.buffer = mediaElement.buffer;
    source.connect(analyser);
   analyser.connect(audioContext.destination);

Try replacing this with:

const source = ws.getMediaElement().getGainNode()
source.disconnect()
source.connect(analyser)
analyser.connect(audioContext.destination)

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by WickyPlays
Comment options

You must be logged in to vote
2 replies
@katspaugh
Comment options

@WickyPlays
Comment options

Comment options

You must be logged in to vote
3 replies
@katspaugh
Comment options

@WickyPlays
Comment options

@katspaugh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants