2022-05-12
2908
#vanilla javascript
Iskander Samatov
106930
May 12, 2022 ⋅ 10 min read

Write an audio visualizer from scratch with vanilla JavaScript

Iskander Samatov I’m a technical lead at HubSpot based in Dallas-Fort Worth Metropolitan Area. When I have time, I enjoy working on SaaS products and writing programming articles at https://isamatov.com.

Recent posts:

Rxjs Adoption Guide: Overview, Examples, And Alternatives

RxJS adoption guide: Overview, examples, and alternatives

Get to know RxJS features, benefits, and more to help you understand what it is, how it works, and why you should use it.

Emmanuel Odioko
Jul 26, 2024 ⋅ 13 min read
Decoupling Monoliths Into Microservices With Feature Flags

Decoupling monoliths into microservices with feature flags

Explore how to effectively break down a monolithic application into microservices using feature flags and Flagsmith.

Kayode Adeniyi
Jul 25, 2024 ⋅ 10 min read
Lots of multi-colored blue and purplish rectangles.

Animating dialog and popover elements with CSS @starting-style

Native dialog and popover elements have their own well-defined roles in modern-day frontend web development. Dialog elements are known to […]

Rahul Chhodde
Jul 24, 2024 ⋅ 10 min read
Using Llama Index To Add Personal Data To Large Language Models

Using LlamaIndex to add personal data to LLMs

LlamaIndex provides tools for ingesting, processing, and implementing complex query workflows that combine data access with LLM prompting.

Ukeje Goodness
Jul 23, 2024 ⋅ 5 min read
View all posts

One Reply to "Write an audio visualizer from scratch with vanilla JavaScript"

  1. This was super helpful, but I noticed a slight error in the sample code under “Resizing the Bars” — the second loop requires some adjustments to actually render that half of the visualizer on page.

    I was able to get it working by:
    1. Resetting the value of x in between the two loops.
    2. Setting the X argument of the call to fillRect in the second loop to canvas.width / 2 + x.

    I see a different approach was taken as I examine the code further on in “Tuning the Performance”, which leverages two separate X values, but the result is the same.

Leave a Reply