Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
Weird crackling during playback - web audio api

I am using Web Audio API + extended Karplus-Strong algorithm to generate plucked string sound and play it.
The problem that I face is sometimes there's a weird crackling sound/thump when playing some particular chords, see example here https://demiurg.app/player/MetallicA/Fade-To-Black/?id=117. First 20 or so measures generate such problem.
At first I thought that this is an effect of a DC offset, so I applied a high-pass filter, but nothing really changed.
While searching over the internet I've found some examples that resemble my case, there's a bunch of youtube videos about changing the buffer size (rendering quantum size) for different DAWs to overcome such effect, but there's no way of doing it in Web Audio API atm. The default on all browsers should be 128.
Interestingly enough, when I apply a slight distortion via cubic curve, the crackling effect is mitigated, but it doesn't go away.

Has someone else encountered this issue with generated sound? How can this be solved or mitigated without signal distortion?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

So, apparently this is the way the web audio works, it cannot handle smooth transitions when playing back sound, which results in such clicks or crackling.
This, this and this links helped me come to a conclusion that a custom ADSR envelope is needed. When I applied such envelope to gradually but very fast increase the amplitude of the sound at the beginning and rapidly decrease it at the end the clicks went away.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!