Web Audio API: Browser Sound Apps, Synthesis & Visualization

Web Audio API for In-Browser Sound: Development, Synthesis, and Visualization

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1285
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1241
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1033
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1104
  • image_website-_0.webp
    Website development for Red Pear
    554

Web Audio API for In-Browser Sound: Development, Synthesis, and Visualization

A regular <audio> tag can only play mp3 files. If you need to synthesize sound in real time, apply a chain of effects (filter, reverb, delay), or display a spectrogram, you need the Web Audio API. For any browser audio application, this API is the standard choice. According to the Web Audio API Specification from W3C, it runs in a separate thread without blocking the UI and delivers latency under 1 ms—a hundred times faster than setTimeout with a 4 ms tick. Over 95% of modern browsers support it. Over 10 years, we've implemented dozens of audio projects: from sequencers for Ableton-like interfaces to voice analyzers for telemedicine. A typical client problem: "We built a player using <audio>, now we need to add an equalizer and visualization—and everything lags." The solution is migrating to the API with a properly designed node graph. This not only offloads the main thread but also gives sample-level precision. Development with this technology is 30% cheaper than building a native audio application for each platform—you get a single solution for all browsers.

When Do You Need Web Audio API?

Without this API, you can't:

  • synthesize sound (oscillators, noise);
  • apply effects (filters, reverb, delay);
  • visualize the audio spectrum in real time;
  • create musical instruments with sample-level accuracy.

What Problems We Solve

AudioContext Autoplay. Browsers block creating an AudioContext without a user gesture (click, touch). If you ignore this, the app "goes silent"—the user presses play, but there's no sound. We solve this by calling resume() after handling a user gesture.

Latency Management. Event-driven approaches (setTimeout/interval) introduce jitter of 10–15 ms—disastrous for a rhythmic sequencer. The API allows scheduling notes with sample-level accuracy (1/44100 s) using a lookahead scheme. In a recent project, we built a 16-step drum sequencer with timing accuracy of 1 ms—the client confirmed that the rhythm does not drift even at 140 BPM.

N+1 Requests When Loading Samples. Loading each sample individually results in many small fetch requests. We buffer loading and cache the AudioBuffer.

How We Design a Lag-Free Audio Graph

A lookahead scheme is key to stable rhythm. We schedule notes 100 ms ahead with step-level accuracy (16th notes). Parameters like BPM, step activity, and velocity are controlled from the UI. This approach is used in our StepSequencer class.

In a typical project, we design a node graph for the specific task. For example, for a sequencer with visualization:

Oscillators/Source → DynamicsCompressorNode → GainNode → AnalyserNode → Destination 

The AnalyserNode delivers data for the spectrogram (frequencies) or oscilloscope (time domain). We render them on Canvas via requestAnimationFrame—achieving up to 60 FPS even on mobile.

Step-by-Step: Building a Simple Synthesizer

  1. Create an AudioContext: new AudioContext().
  2. Create an OscillatorNode: context.createOscillator().
  3. Create a GainNode for the envelope: context.createGain().
  4. Connect: oscillator → gain → destination.
  5. Set frequency and wave type (sine, square, sawtooth, triangle).
  6. Schedule start and end with sample-level precision using oscillator.start() and oscillator.stop().
  7. Apply an ADSR envelope using gain.linearRampToValueAtTime().

Synthesis: Oscillator + ADSR

The playNote function creates a sawtooth oscillator, a low-pass filter (frequency 2000 Hz, Q=2), and a gain envelope: attack 10 ms, decay 90 ms, sustain 0.4, release 400 ms. This synthesis gives a "warm" analog sound. For different timbres, change the oscillator type (sine, square, triangle) or filter parameters.

Why Order Development from Us

We have 10+ years of experience in browser audio and dozens of implemented audio applications. We guarantee your project will work in Chrome, Firefox, Safari, and Edge, accounting for all nuances of autoplay policy and latency. The cost is calculated individually after assessing the scope—you don't overpay for unnecessary features. For example, a basic audio player with visualizer starts at $500, while a full drum sequencer costs around $2000. To evaluate how the API fits your project, get a consultation with our engineer. We will analyze the task and propose an architecture.

Time Estimates

Task Timeframe
Audio player with visualizer 2–3 days
Drum sequencer (16 steps, 4 tracks) 6–8 days
Synthesizer with ADSR envelope 6–10 days
Microphone input analysis + effects 5–7 days

Our Process

Stage What We Do
Analysis Define audio functionality requirements
Design Build the node graph, choose sample rate
Implementation Code in TypeScript, use AudioContext
Testing Verify in Chrome, Safari, Firefox
Deployment Optimize, integrate into your project

What's Included in the Work

  • Node graph design.
  • UI implementation: play/stop buttons, tempo and volume controls, visualizer.
  • Error handling: autoplay, missing getUserMedia.
  • Performance optimization: proper AudioContext management, avoiding leaks.
  • Build and access documentation.
Browser Support Details Web Audio API is supported in Chrome 14+, Firefox 23+, Safari 6+, Edge 12+. However, some features like AudioWorklet require more recent versions. We ensure compatibility based on your target audience.

Get a consultation for your project—we'll assess the task and propose a solution. Contact us for a cost and timeline estimate. Your audio application will run in modern browsers without lag.

For more details, see the MDN documentation.