ZERO-CONFIG AUDIO PLAYER

Beautiful Audio Visualization
No JavaScript Required

Just add data attributes to any div. Auto-initialization, responsive design, and stunning waveforms out of the box.

~8KB Gzipped
Media Session API
Keyboard Controls
Speed Control
QUICK START

Get Started in 30 Seconds

Include the files, add data attributes, done.

<!-- 1. Include the files -->
<link rel="stylesheet" href="https://unpkg.com/@arraypress/waveform-player@latest/dist/waveform-player.css">
<script src="https://unpkg.com/@arraypress/waveform-player@latest/dist/waveform-player.js"></script>

<!-- 2. Add a player -->
<div data-waveform-player
     data-url="your-audio.mp3"
     data-title="Song Title"
     data-artwork="cover.jpg">
</div>

No initialization. No configuration. It just works.

VERSION 1.1

Professional Features

Everything you need for a complete audio experience

System Integration NEW

Shows on lock screens, media keys work, bluetooth controls supported

Full Keyboard Control NEW

Try it: Click player then use Space (play), โ†โ†’ (seek), โ†‘โ†“ (volume), M (mute), 0-9 (position)

Speed Control NEW

Perfect for podcasts and audiobooks. Click the speed button to adjust.

WHY CHOOSE

Built for Modern Web

Everything you need, nothing you don't

Zero JavaScript

Works with just HTML data attributes. Perfect for WordPress, static sites, or any CMS.

Fully Customizable

Control every color, dimension, and style through simple data attributes.

System Integration

Media Session API support for lock screens, hardware keys, and bluetooth controls.

Lightweight

Just ~8KB gzipped. No jQuery, no dependencies, pure vanilla JavaScript.

6 Visual Styles

Bars, mirror, line, blocks, dots, and seekbar. Each optimized for clarity.

Performance First

Canvas rendering, RequestAnimationFrame, and optimized resampling.

LIVE EXAMPLES

See It In Action

Different styles for different vibes

SoundCloud Style mirror + artwork
Classic Bars bars
Spotify Green bars
Oscilloscope line
LED Meter blocks
Circular Dots dots
Simple Seekbar seekbar
INTERACTIVE PLAYGROUND

Control & Events

See how to programmatically control players and track events

Programmatic Control

const player = WaveformPlayer.getInstance('player-id');
player.play();
player.pause();
player.seekToPercent(0.5);
player.setVolume(0.5);

Event Tracking

Play Count 0
Total Time 0s
Completion 0%
Waiting for events...
new WaveformPlayer('#player', {
    onPlay: (player) => trackEvent('play'),
    onPause: (player) => trackEvent('pause'),
    onEnd: (player) => trackEvent('complete'),
    onTimeUpdate: (current, total) => updateProgress(current)
});
PLAYER BUILDER

Build Your Perfect Player

Customize every aspect and copy the code

Preview

Customize

30%
90%
90%
Note: External URLs may not work due to CORS restrictions

Generated Code

<div data-waveform-player
     data-url="audio.mp3"
     data-waveform-style="bars"
     data-bar-width="2"
     data-bar-spacing="0">
</div>
ADVANCED FEATURES

Pro Features

Advanced capabilities for power users

BPM Detection data-show-bpm="true"

Note: BPM detection works best with rhythmic content like drums or electronic music. Detection accuracy may vary with complex patterns or live recordings.

Chapter Markers markers

Using Markers

// HTML with data attribute
<div data-waveform-player
     data-url="audio.mp3"
     data-markers='[
         {"time": 2, "label": "Verse", "color": "#4ade80"},
         {"time": 5, "label": "Chorus", "color": "#f59e0b"},
         {"time": 8, "label": "Bridge", "color": "#ef4444"}
     ]'>
</div>

// Or via JavaScript
new WaveformPlayer('#player', {
    url: 'audio.mp3',
    markers: [
        {time: 2, label: 'Verse', color: '#4ade80'},
        {time: 5, label: 'Chorus', color: '#f59e0b'},
        {time: 8, label: 'Bridge', color: '#ef4444'}
    ]
});

Perfect for:

  • ๐Ÿ“š Podcast chapters and segments
  • ๐ŸŽต Song sections (verse, chorus, bridge)
  • ๐ŸŽ“ Educational content with topics
  • ๐Ÿ“– Audiobook chapters
  • ๐ŸŽ™๏ธ Interview highlights
Dynamic Track Loading loadTrack()

Loading New Tracks

// Get player instance
const player = WaveformPlayer.getInstance('switcher-player');

// Load a new track with all options
await player.loadTrack(
    'new-song.mp3',           // URL
    'Song Title',             // Title
    'Artist Name',            // Subtitle
    {                         // Additional options
        markers: [
            {time: 30, label: 'Verse 1'},
            {time: 60, label: 'Chorus'},
            {time: 90, label: 'Bridge'}
        ],
        waveformStyle: 'mirror',
        showBPM: true,
        artwork: 'cover.jpg'
    }
);

// Simple track change
await player.loadTrack('another-song.mp3', 'Another Song');

Use Cases:

  • ๐ŸŽต Music playlists and albums
  • ๐Ÿ“š Podcast episode switchers
  • ๐ŸŽ“ Course lesson navigation
  • ๐Ÿ“– Audiobook chapter selection
  • ๐ŸŽ™๏ธ Radio show segments
Timestamp Navigation seekTo()

Description:

This mix starts with a smooth 0:00 intro, building energy at 0:03. The main drop hits at 0:06 before winding down at 0:09.

Waveform Data Generator

200
// Waveform data will appear here...
                    

Using Pre-generated Data

// Generate once
const waveformData = await WaveformPlayer.generateWaveformData(
    'audio/song.mp3',
    200 // samples
);

// Save to your database/API
await saveToDatabase(waveformData);

// Later, use the cached data
new WaveformPlayer('#player', {
    url: 'audio/song.mp3',
    waveform: waveformData, // Use pre-generated data
    title: 'Optimized Player'
});

Benefits

  • โšก Instant waveform display (no processing)
  • ๐Ÿ’พ Can be cached server-side
  • ๐Ÿ”’ Works with protected/authenticated audio
  • ๐Ÿ“ฑ Reduces client-side processing on mobile
DOCUMENTATION

Configuration Reference

All available data attributes

Attribute Default Description
data-url - Audio file URL (required)
data-waveform-style bars Visual style: bars, mirror, line, blocks, dots, seekbar
data-bar-width 2 Width of bars in pixels
data-bar-spacing 0 Space between bars
data-samples 200 Waveform detail level (100-400)
data-height 60 Canvas height in pixels
data-waveform-color - Inactive waveform color
data-progress-color - Active waveform color
data-button-color - Play button color
data-title Filename Track title
data-subtitle - Track subtitle/artist
data-album - Album name for Media Session
data-artwork - Album artwork URL (shows in player and system controls)
data-enable-media-session true Enable system media controls
data-show-bpm false Show BPM detection
data-show-playback-speed false Show speed control menu
data-playback-rate 1 Initial playback speed (0.5-2)
data-autoplay false Auto-start playback
data-show-time true Show time display
data-markers - JSON array of marker objects with time, label, and color
QUESTIONS ANSWERED

Frequently Asked Questions

Why not use WaveSurfer.js?

WaveSurfer is a solid, battle-tested library. But it's 40KB+ minified, requires configuration, and can be complex for simple use cases. WaveformPlayer is just ~8KB, works with zero JavaScript, and is perfect for WordPress, Shopify, or any CMS where you just want to add audio players without touching code.

How is this different from Amplitude.js?

Amplitude is great for building full music players with playlists. WaveformPlayer focuses on one thing: beautiful waveform visualization with minimal overhead. If you need playlists and complex controls, use Amplitude. If you want drop-in waveforms, this is for you.

Can I use this in WordPress?

Absolutely! Just enqueue the CSS and JS files in your theme, then use data attributes in your content. Works perfectly with Gutenberg blocks, shortcodes, or any page builder. A dedicated WordPress plugin is coming soon.

Does it work with Shopify?

Yes! Upload the files to your theme's assets folder, include them in theme.liquid, then add players anywhere using data attributes. Perfect for music previews, podcast episodes, or audio samples.

What about React/Vue/Angular?

The vanilla version works perfectly in any framework. Just include the script and use data attributes in your JSX/templates. For React, you can also use the programmatic API in useEffect/componentDidMount.

Is the waveform real or fake?

100% real! We decode your audio file using the Web Audio API and generate actual waveform data. Every peak and valley represents the true amplitude of your audio.

Can I customize the colors?

Every color is customizable via data attributes. Set waveform color, progress color, button color, text color, and more. Or use the light/dark presets and tweak from there.

What browsers are supported?

All modern browsers from the last 2-3 years. Chrome 88+, Firefox 85+, Safari 14+, Edge 88+. We use standard Web Audio API and Canvas, no experimental features.

Can I preload waveform data?

Yes! Generate waveform data server-side or cache it, then pass it via data-waveform attribute. This gives instant visualization without waiting for audio decode.

Does it handle large files?

Files up to 100MB work fine. The waveform generates progressively, so users see something immediately. For huge files (podcasts, audiobooks), consider using streaming or chunked loading.

What about accessibility?

Full keyboard navigation (space, arrows, etc), ARIA labels, focus indicators, and screen reader announcements. The player is WCAG 2.1 AA compliant.

Can I use custom fonts?

The player inherits your site's fonts automatically. Just set your font-family in CSS and the player will use it for titles and time displays.

Is there a Pro version?

No! Everything is free and open source. We believe audio players should be accessible to everyone. If you love it, star us on GitHub or buy us a coffee.

How do I track analytics?

Use the JavaScript API to hook into play, pause, and progress events. Send these to Google Analytics, Mixpanel, or your custom analytics. Check the Playground section for examples.

Can I use this commercially?

Yes! MIT license means you can use it for anything - commercial projects, client work, SaaS products. No attribution required (but appreciated).

What if JavaScript is disabled?

The player gracefully falls back to a styled container with title/subtitle visible. You could also include a standard HTML5 audio element as fallback content.

Ready to Upgrade Your Audio Players?

Free, open-source, and ready to use in your next project