October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk7 min

Building a Simpler Browser-Based Spectrum Analyzer: What the Web Audio API Requires

A browser spectrum analyzer is mostly one audio source, one AnalyserNode, and a drawing loop. Here is what the Web Audio API needs, which settings change the display, and where simplicity comes from.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A browser-based spectrum analyzer needs very little machinery: an audio source, an AnalyserNode from the Web Audio API that computes a frequency snapshot, and a loop that draws that snapshot on a canvas. Most of the complexity people associate with these tools comes from choices layered on top of that core, such as how many input sources to support, how many controls to expose, and how much setup a visitor must do before anything moves. This article explains the browser mechanics first, then the choices that make a tool simpler or heavier. It does not document the feature set of any particular project; the details of one specific tool are outside what is covered here.

What a browser spectrum analyzer is made of

Three pieces do the work in nearly every browser implementation. The first is an audio source. The second is an analysis node. The third is a rendering loop that reads the analysis data and paints it.

As an Amazon Associate I earn from qualifying purchases.

The audio source

The source determines what the analyzer can see. A live microphone, a local audio file, and a captured tab or system stream all end up as a node in the same Web Audio graph, so the analysis code does not need to know where the sound came from. The source choice still affects permissions, latency, and what a visitor has to do before the display starts, which is covered below.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The AnalyserNode

According to MDN’s Web Audio documentation, AnalyserNode exposes both frequency-domain data, computed with a Fast Fourier Transform (FFT), and time-domain data that can be drawn as a waveform. Frequency data is what most people mean by a spectrum display. The node passes audio through unchanged, so it can sit between the source and the output without altering playback.

#1 Best Overall
Sale
SeeSii TinySA Ultra+ ZS406 Spectrum Analyzer, 4.0 Inch 100kHz to 5.4GHz Handheld Tiny Frequency Analyzer with 32Gb Card, 2-in-1 Signal Generator MF/HF/VHF UHF Input,V0.4.6.1,2025 Upgraded
  • Upgraded ZS406 TinySA Ultra+:This New Version V0.4.6.1 Spectrum Analyzer is developed by Hugen, with 4.0 inch 480 x 320 large touchscreen display, 100kHz to 5.4GHz widely measure range, with the new ESD protection function, the product has a higher anti-static level and a longer service life, and built-in 32Gb micro SD card, can directly record data to the card ,which is convenient for your data sharing and storage
  • Widely Frequency Range: Compared to the tinysa (100kHz to 960MHz), the upgraded tinysa ULTRA+ has 100kHz to 5.4GHz ultra-wide measuring frequency range, spectrum analyzer for 0.1-800MHz, with Ultra mode up to 0.1MHz-6GHz.Switchable resolution band pass filters for both ranges between 200Hz to 850kHz. Color display showing 450 scan points covering up to the full low or high frequency range. Faster and more accurate measurement performance, you can easily cope with measurement testes in various fields
  • 2 in 1 Multifunctional Frequency Analyzer & Signal Generator:When not used as Spectrum Analyzer it can be used as Signal Generator,with sine wave output between 0.1-800MHz or square wave or dual tone output up to 4.4GHz.Built-in calibration signal generator that is used for automatic self test and low input calibration
  • PC Control: Connected to a PC via USB it becomes a PC controlled Spectrum Analyzer or Signal Generator.Tinysa-APP transfers data directly to the computer.The USB interface implements CDC protocol and there is a large set of commands that can be invoked over the serial interface. These command can be used to perform measurements or update internal settings. The driver for Windows will install automatically after connecting to a Windows PC. The driver for Linux is built into the kernel
  • Ultra-long Battery Life: The upgraded tinysa analyzer built-in 5000mAh battery,with type-C charging cable and LED charging indicator,it can be fully charged within 3 hours,no need to charge frequently

The drawing loop

The analyzer does not stream a continuous spectrum. It takes a snapshot each time the loop runs. A typical loop calls a data method, maps the values to bar heights or line points, and schedules the next frame with requestAnimationFrame. Snapshot rate therefore follows the display refresh rate, not the audio sample rate.

The settings that change what you see

Four properties of the analysis node control most of the visible behavior. The table below lists them with the values the W3C Web Audio API specification and MDN describe.

Rank #2
SeeSii TinySA Ultra+ ZS407 7.3GHz Spectrum Analyzer: 2026 Upgraded 4 Inch HW V0.5.4 100kHz-7.3GHz Handheld Tiny Frequency Analyzer - 2-in-1 RF Signal Generator 100kHz to 900MHz MF/HF/VHF UHF
  • 2026 Upgraded Tinysa Ultra+ ZS407 Spectrum Analyzer: Supports an ultra-wide frequency range of 100kHz–7.3GHz, delivering precise test data for RF system development, satellite alignment, and frequency verification. Features a 4.0-inch HD touchscreen (480×320 resolution) with up to 450 scan points for clear visualization of complex spectrum data. The intuitive interface ensures ease of use, while ESD protection and the latest V0.5.4 hardware system provide professional and stable performance
  • Broad Frequency Coverage: Supports 100kHz–7.3GHz, ideal for 5G NR, Wi-Fi 6E, satellite communications, and higher wireless frequency bands. Calibrated up to 8GHz, it enables broader applications for high-frequency testing in lab environments. Standard mode covers 100kHz–800MHz, while ULTRA mode extends to 6GHz. With 200Hz–850kHz RBW, it ensures fast, efficient measurements, meeting high-precision needs like SSB two-tone intermodulation tests
  • Robust Signal Generation: Functioning as both a spectrum analyzer and signal generator, it produces MF/HF/VHF sine waves from 100kHz-900MHz, UHF square waves from 800MHz-6.3GHz, and mixed signals from 4.4GHz-6.3GHz. Our spectrum analyzer antenna's versatility is perfect for RF system development, wireless communication debugging, and RF interference detection, aiding professionals in identifying and resolving frequency issues
  • Convenient PC Control and Data Transfer: With USB and TinySA-APP connectivity, the device supports real-time data display and transfer, enhancing data management efficiency. This sdr spectrum analyzer includes a 32GB MicroSD card for easy data storage and sharing, catering to spectrum scanning, signal detection, and radio noise measurement needs
  • 10-Hour Working Time: Powered by a 5000mAh battery, it offers up to 10 hours of continuous operation, ideal for field use by RF interference troubleshooters and satellite communication technicians. This signal analyzer's compact design makes it portable for various work environments, facilitating quick wireless signal detection and analysis for electronic and audio technicians
Setting What it controls Specified values or default Practical effect
fftSize Number of sample frames in each FFT analysis Power of two from 32 to 32768; default 2048 per the W3C specification Larger values give finer frequency bins but cost more to compute and respond more slowly to change
frequencyBinCount Number of frequency values returned Always half of fftSize Sets the array length you allocate for each snapshot
smoothingTimeConstant Blending of each snapshot with the previous one Value from 0 to 1; default 0.8 per the W3C specification Higher values give steadier bars; lower values track transients more closely
minDecibels / maxDecibels Range mapped for byte-scaled frequency data Defaults of -100 and -30 dB per the W3C specification Sets the vertical scale; values outside the range clip

Frequency resolution depends on sample rate

The width of each frequency bin is the audio context’s sample rate divided by fftSize. At a 48,000 Hz context rate with the default 2048 frames, each bin is about 23.4 Hz wide. The same calculation at 44,100 Hz gives about 21.5 Hz. The sample rate is set by the browser and audio device, so the bin width is a property of the running context, not a fixed number a developer can promise. Treat any resolution claim as valid only for the sample rate and fftSize it was measured with.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the FFT size is a trade-off

Doubling fftSize halves the bin width and doubles the time window each snapshot covers. Low frequencies benefit from the longer window. Fast percussive changes blur across it. The specification’s warning that larger sizes can cost more to compute matters most on phones and low-powered laptops, where a large size combined with several analyzers can make the drawing loop stutter.

Rank #3
Portable TinySA Spectrum Analyzer,SEESII Upgraded V0.3.1 Handheld Tiny Frequency Analyzer 100kHz to 960MHz MF/HF/VHF UHF Input,Signal Generator with 2.8 inch Touch Screen with ESD Protect Function
  • Frequency Range :Tiny Spectrum Analyzer with two inputs, high quality MF/HF/VHF input for 0.1MHZ-350MHz, lesser quality UHF input for 240MHz-960MHz. Switchable resolution bandpass filters for both ranges between 2.6kHz and 640kHz. Color display showing 290 scan points covering up to the full low or high frequency rangefrequency range. The tinySA contains all the components of a conventional heterodyne swept spectrum analyzer
  • Built-in Calibration Signal Generator:When not used as Spectrum Analyzer it can be used as Signal Generator, MF/HF/VHF sinus output between 0.1MHZ-350MHz, UHF square wave output between 240MHz-960MHz. Built-in calibration signal generator that is used for automatic self test and low input calibration
  • Tiny Spectrum analyzers & ESD Function: Switchable resolution bandpass filters for both ranges between 2.6kHz and 640kHz.Color display showing 290 scan points covering up to the full low or high frequency range. Bulit-in rechargeable battery allowing a minimum of at least 2 hours portable use.The performance of the 2021 latest version 3.1 will be more stable and sensitive, with a new ESD protrcted function enable the product to have a higher antistatic level and a longer service life
  • PC Control: Connected to a PC via USB it becomes a PC controlled Spectrum Analyzer.The USB interface implements the Serial over USB (CDC) protocol and there is a large set of commands that can be invoked over the serial interface. These command can be used to perform measurements or update internal settings. The driver for Windows will install automatically after connecting to a Windows PC. The driver for Linux is built into the kernel
  • Package List: 1x Tiny Spectrum Analyzer; 2 x 20cm RF Cable;1 x USB Cable;1 x SMA Female to Female Connector;1x Touchscreen Pen;1 x SMA Telescopic Antenna.It's very useful as an antenna analyzer for your ham station, easy to set without fancy calibration.The firmware of the tinySA can be updated by the user. New versions of the firmware needed please contact seller for download link

Choosing an input source

Each input path has different requirements. The table compares the three common options at a conceptual level. Browser and operating-system support for each path varies, so check the current documentation for the browsers you target.

Input Typical browser route What the visitor must do Best suited to
Microphone navigator.mediaDevices.getUserMedia with an audio constraint, connected through createMediaStreamSource Grant microphone permission; on iPhone, enable microphone access for the browser in system settings Live sound in a room, instruments, voices
Local audio file Load the file into an AudioBuffer or an audio element, then route it through an AudioBufferSourceNode or createMediaElementSource Choose a file; no permission prompt for the file itself Offline review of recordings, repeatable comparisons
Tab or system audio navigator.mediaDevices.getDisplayMedia with audio requested Pick a tab or screen and confirm audio sharing; not every browser or operating system offers it Analyzing playing media without a microphone

For a simpler tool, supporting one input well is often better than offering all three in a half-finished state. A file-only analyzer needs no permission flow at all, and that alone removes the most common point where visitors give up.

Rank #4
SeeSii TinySA Ultra+ ZS406 Spectrum Analyzer: 4.0 Inch 5.4GHz Handheld Tiny Frequency Analyzer with ZK06-UM 21dB LNA Module 32Gb Card—100kHz to 800MHz MF/HF/VHF UHF Input, 2025 Upgraded
  • Experience unparalleled performance with the ZK06-UM 21dB LNA Module, offering a broadband frequency range of 10 MHz to 6 GHz, robust 18 dBm output power, impressive 21 dB gain, ultra-low noise, and convenient USB type-C power supply
  • SeeSii Upgraded TinySA Ultra+: This New Version V0.4.6 Spectrum Analyzer is developed by Hugen, with 4.0 inch 480 x 320 large touchscreen display, 100kHz to 5.4GHz widely measure range, with the new ESD protection function, the product has a higher anti-static level and a longer service life, and built-in 32Gb micro SD card, can directly record data to the card ,which is convenient for your data sharing and storage
  • Frequency Range: Compared to the tinysa (100kHz to 960MHz), the upgraded tinysa ULTRA+ has 100kHz to 5.4GHz ultra-wide measuring frequency range, spectrum analyzer for 0.1-800MHz, with Ultra mode up to 0.1MHz-6GHz.Switchable resolution band pass filters for both ranges between 200Hz to 850kHz. Color display showing 450 scan points covering up to the full low or high frequency range. Faster and more accurate measurement performance, you can easily cope with measurement testes in various fields
  • 2 in 1 Multifunctional Frequency Analyzer & Signal Generator: When not used as Spectrum Analyzer it can be used as Signal Generator,with sine wave output between 0.1-800MHz or square wave or dual tone output up to 4.4GHz.Built-in calibration signal generator that is used for automatic self test and low input calibration
  • PC Control: Connected to a PC via USB it becomes a PC controlled Spectrum Analyzer or Signal Generator.Tinysa-APP transfers data directly to the computer.The USB interface implements CDC protocol and there is a large set of commands that can be invoked over the serial interface. These command can be used to perform measurements or update internal settings. The driver for Windows will install automatically after connecting to a Windows PC. The driver for Linux is built into the kernel

Permissions and secure context

  • Microphone and display capture APIs are generally available only in a secure context, which means HTTPS or localhost during development.
  • A visitor who denies microphone permission gets a rejected promise from getUserMedia. Show a short message that explains the next step rather than a blank canvas.
  • Browsers typically require an AudioContext to be created or resumed after a user gesture such as a button press. If the context starts in a suspended state, the analyzer draws nothing until the context is resumed.
  • On iPhone and iPad, microphone access must be allowed for the browser in the system settings as well as in the page prompt.

A minimal build, step by step

  1. Create the context on a user action: const ctx = new AudioContext(); then call ctx.resume() inside the click handler.
  2. Create the analysis node and set its size: const analyser = ctx.createAnalyser(); analyser.fftSize = 2048;
  3. Allocate one array for the snapshot: const bins = new Float32Array(analyser.frequencyBinCount);
  4. Connect your source to the analyser. For a microphone, call ctx.createMediaStreamSource(stream).connect(analyser);. For a file or media element, connect its source node the same way.
  5. Connect the analyser to playback only if the visitor should hear the audio. A microphone path usually should not route to the speakers, because that causes feedback.
  6. In the drawing loop, call analyser.getFloatFrequencyData(bins);, map each value from decibels to a pixel height, paint the canvas, and schedule the next frame with requestAnimationFrame.
  7. Test the path on the slowest device you intend to support, and reduce fftSize or the number of drawn bins if frames drop.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What “simpler” can mean in practice

People who want a simpler analyzer usually reduce one of four things. Each reduction has a cost, so decide which one matters for your readers before you cut anything.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Input choices. One source removes permission handling and device selection. The cost is that visitors with a different source have to leave the page.
  • Controls. Fixing fftSize, smoothing, and the dB range removes a settings panel. The cost is that expert users cannot tune the display to their material.
  • Setup. Starting the analysis on one click, with no configuration step, removes friction. The cost is that the first run may need an explicit gesture for audio to start.
  • Output. Showing one view, such as bars, is easier to build and read than offering bars, a waterfall, and a numeric readout together.

Visualization is not measurement

A browser analyzer is a useful way to see where energy sits in a signal. It is not, by default, a calibrated measurement instrument. The displayed values are relative decibel levels scaled by minDecibels and maxDecibels, and they depend on the device’s input gain, its microphone, and the browser’s processing. Use a measurement microphone only if you need a specific input for live acoustic work, and do not treat browser readings as accurate absolute sound levels without independent calibration. File-based analysis avoids the microphone question entirely, which is one reason it is the simplest starting point.

Best Value
Portable Tinysa Spectrum Analyzer, AURSINC V0.3.1 Handheld Frequency Analyzer, Signal Generator 100kHz to 960MHz MF/HF/VHF UHF Input ESD Protected Function with 2.8 inch Touchscreen
  • [Tiny Spectrum analyzer] AURSINC Tinysa spectrum analyzer produced by Hugen, with hardware V0.3.1. The firmware of the tinySA can be updated, for newest firmware version update, please refer to: tinysa .org. The version info displayed indicates "ESD Protection" with a diode to improve stability, sensitivity, anti-static level, and longevity
  • [Frequency Range] The tiny sa spectrum analyzer with two inputs, high quality MF/HF/VHF input for 0.1MHZ-350MHz, lesser quality UHF input for 240MHz-960MHz. Switchable resolution bandpass filters for both ranges between 2.6kHz and 640kHz. The tinysa includes all the components of a traditional heterodyne swept spectrum analyzer, with a color display showing 290 scan points covering up to the full low or high frequency range
  • [Built-in Calibration Signal Generator] When not used as Spectrum Analyzer it can be used as Signal Generator, MF/HF/VHF sinus output between 0.1MHZ-350MHz, UHF square wave output between 240MHz-960MHz. Built-in calibration signal generator enables automatic self-test and low input calibration
  • [PC Control] The USB interface realizes the Serial over USB (CDC) protocol and a large number of commands can be called through the serial interface. The commands can be used for measurements or updating internal settings. The Windows driver will automatically install upon connecting to a Windows PC. The driver for Linux is built into the kernel. Tinysa-APP is available to control the tinysa and capture its screen
  • [Package List] 1x Tiny Spectrum Analyzer(Bulit-in 500mah battary, 2.8inch touchsreen) ; 2x 20cm/7.87inch RF Cable; 1x USB-C Cable ; 1x SMA Female to Female Connector; 1x Touchscreen Pen; 1x SMA Telescopic Antenna

The W3C Web Audio API specification describes fftSize as “the size of the FFT used for frequency-domain analysis (in sample-frames).” That definition is the reason the number is a processing parameter, not a claim about the accuracy of what appears on screen.

Whether a particular project is simpler than alternatives depends on the features it leaves out, and those are not covered in this article. The checklist below is a way to judge any browser analyzer, including your own.

  • Which input sources does it support, and what does each one require from the visitor?
  • Can it run offline on a file, without a network connection or an account?
  • Which fftSize and dB range does it use, and does it state the resulting bin width?
  • Does it say clearly that its display is not a calibrated measurement?
  • Does it work after denied permissions, a suspended context, and a slow device?

Frequently Asked Questions

Do I need a measurement microphone to build a browser spectrum analyzer?

No. A file-based analyzer needs no microphone at all, and a built-in or headset microphone is enough for live sound. A measurement microphone is only worth considering if you need a defined input response for live acoustic work, and even then browser readings are not calibrated measurements by default.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does my analyzer show nothing until I click something?

Browsers commonly start an AudioContext in a suspended state until a user gesture occurs. Create or resume the context inside a click or tap handler, then start the drawing loop.

The Bottom Line

A simpler browser spectrum analyzer is built from a single source, an AnalyserNode with a sensible fftSize, and a lean drawing loop. Choose the input path and the controls that your readers actually need, and state plainly what the display does and does not measure.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.