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:

Nx Adoption Guide: Overview, Examples, And Alternatives

Nx adoption guide: Overview, examples, and alternatives

Let’s explore Nx features, use cases, alternatives, and more to help you assess whether it’s the right tool for your needs.

Andrew Evans
Mar 28, 2024 ⋅ 9 min read
Understanding Security In React Native Applications

Understanding security in React Native applications

Explore the various security threats facing React Native mobile applications and how to mitigate them.

Wisdom Ekpotu
Mar 27, 2024 ⋅ 10 min read
Warp Adoption Guide: Overview, Examples, And Alternatives

warp adoption guide: Overview, examples, and alternatives

The warp web framework for Rust offers many enticing features. Let’s see when and why you should consider using warp in your projects.

Ukeje Goodness
Mar 26, 2024 ⋅ 8 min read
Integrating Next Js And Signalr For Enhanced Real Time Web App Capabilities

Integrating Next.js and SignalR to build real-time web apps

In this tutorial, you’ll learn how to integrate Next.js and SignalR to build an enhanced real-time web application.

Clara Ekekenta
Mar 25, 2024 ⋅ 8 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