How to embed an audio player on your website
A portfolio, a podcast page and a client preview all need the same thing: a player that sits on your page and just works. Here are three ways to get one, from paste-and-go to fully automated.

This guide covers three ways to put a working audio player on a web page: the browser's built-in audio tag, a hosted embed you paste in once, and an API that generates players programmatically. At the end there is a section on the laziest workflow of all: letting an AI agent do it over MCP.
The short answer: upload the track to a free Audio.com account, open Share, choose Embed and paste the snippet into your page. The player streams from Audio.com's servers, so your site stays fast and your file keeps its quality. The other two options exist for the edges: the bare HTML5 tag for a single small file you host yourself, and the API for sites with many tracks.
What an embed actually does
An embedded player is a small frame served by an audio host and placed inside your page. The audio file lives on the host, streams from the host and is counted by the host; your page only carries a few lines of HTML. The alternative is self-hosting: the file sits on your server, and storage, bandwidth, encoding and the player interface all become your problem.
That split decides everything that follows. If the audio is one short clip and you run your own server, self-hosting is fine. In every other case, embedding is less work and ages better.
Option 1: the plain HTML5 audio tag
Every browser ships a bare-bones player. Put a file next to your page and write: <audio controls src="track.mp3"></audio> — that is the whole feature.

The costs show up later. You host the file, so every play spends your storage and bandwidth. The player looks different in every browser and shows no title, cover or waveform. And you do your own encoding: serve WAV and mobile visitors pay for ten times the data; serve a low-bitrate MP3 and the music suffers. If you go this route, encode a dedicated listening copy; our guide to WAV, FLAC and MP3 covers the trade-offs.
Use the tag for a single short clip on a server you control: a notification sound demo, a pronunciation sample, a sound effect.
Option 2: paste a hosted embed (the two-minute route)
Create a free account and upload your track. The free plan has unlimited audio storage, so the file can be full quality.
Open the track page and click Share.
Choose Embed, pick a theme and layout, and copy the code.
Paste it wherever your site editor accepts HTML: a custom HTML block in WordPress, a code block in Squarespace, an embed block in most portfolio builders.

The snippet is an iframe plus a small loader script. It loads lazily, so it does not hold up the rest of your page, and the audio streams from Audio.com on demand rather than from your server. Visitors get the full player: cover art, title, author and a seekable waveform.
The track also stays one resource. Fix a typo in the title, swap the cover, replace nothing else, and every page that embeds it shows the change.
Make it fit your page
The embed builder offers light, dark and custom themes — the custom one takes your own surface, text, accent and stroke colors — and four layouts: a fixed-width player whose width you set, a flexible player that fills its container, a compact mini player, and a square 250 by 250 tile for grids. Free embeds show the cover, the author line, a footer and a small audio.com watermark; a paid plan lets you turn each of those off.

Albums and playlists embed too
A Collection — an album, a podcast season, the chapters of an audiobook — embeds the same way a single track does, as one player for the whole set. Listeners move between tracks without leaving your page.
Option 3: generate embeds with the API
Pasting snippets by hand stops scaling the moment a site has a catalog: a podcast archive, a label roster, a sample library, a course with fifty lessons. For that there is the Audio.com public API, which covers the full loop: upload audio, organize it into collections, read stats and generate embed code.

Authentication is OAuth 2.1 with PKCE, and clients can register themselves, so there are no API keys to copy around: your app asks the user to sign in once and requests a single scope. After that, one GET request to the embed endpoint returns ready-to-paste HTML for any of the user's tracks or collections. The endpoint accepts the track's URL or its username and slug, and takes the same options as the on-site builder: theme, custom colors, layout, width, and the show-and-hide toggles.
A few details that matter in practice:
Uploads go through a presigned URL and accept WAV, MP3, FLAC, AIFF, OGG, M4A and WavPack files up to 1 GB each.
Stats for plays, downloads and shares are one request away and refresh within about a minute.
Search covers all listed content on Audio.com, not just your own, so an app can also build discovery features.
So a podcast site template, for example, can call the API once per episode at build time and ship every page with a matching dark-theme player, with no one ever opening an embed dialog.
Or tell an AI agent to do it: the MCP server
The same API is exposed as an MCP server at api.audio.com/mcp. MCP, the Model Context Protocol, is the open standard that lets AI assistants use tools, and every operation of the Audio.com API is available as a tool there, behind the same OAuth sign-in.
In practice that means you can connect the server in an MCP-capable assistant, sign in once, and then work in plain language: upload this mix as unlisted, add it to the demos collection, and give me a dark, full-width embed for my portfolio. The agent registers as a client, calls the same endpoints a developer would, and hands you the finished snippet.
The API reference documents both surfaces — there is even a Connect MCP button in its corner — and they are the same operations either way.
Which option when
One short clip on a server you control. The HTML5 audio tag. Nothing to sign up for.
A track, an album or a client preview on a normal site. A hosted embed: upload, Share, Embed, paste.
Many tracks and generated pages. The API, creating the embed code per track at build time.
You would rather describe the result than do the steps. An AI agent connected to the MCP server.
Frequently asked questions
Will an embedded player slow my site down?
No. The widget is an iframe that loads lazily, after the rest of your page, and the audio streams from Audio.com's servers on demand. Your own server never touches the file.
Do listeners need an Audio.com account?
No. Anyone who can open your page can press play, on a computer or a phone, with nothing to install and nothing to sign up for.
Can I embed a track without publishing it to my profile?
Yes. Tracks have two visibilities, Public and Unlisted. An unlisted track stays off your profile and out of search on Audio.com, while visitors to your page can still listen through the embed.
Is embedding free?
Yes. Uploading, sharing and embedding are part of the free plan, with unlimited audio storage. Paid plans add control over the widget itself: hiding the cover, the author line, the footer or the watermark.
What format should I upload for an embed?
The best one you have, ideally lossless. Streaming delivery is handled for you, and your original stays available in full quality. The WAV vs MP3 vs FLAC guide explains which is which.
Put a player on the page
Take the track your site has been missing: sign up for free, upload it, open Share, choose Embed and paste the snippet. If the page is one of hundreds, open the API docs instead — or connect an agent and describe the player you want.
Audio.com Team

