How to Add Audio to a Website Without Slowing It Down
If you’ve recorded a podcast episode, a voice clip for a product page or a track you want visitors to hear, the file your phone or recording software exports is usually a WAV, and five minutes of stereo WAV comes to around 50 MB. Uploading it as it is will work, but depending on how the player is set up, visitors can end up downloading part or all of that file as soon as the page loads, whether they press play or not, and 50 MB is roughly twenty times the weight of an average web page.
Convertio’s audio converter turns that WAV into an MP3 or Opus file of 1 to 5 MB in the browser, with the bitrate, sample rate and channel count set before you download it. A smaller file is only part of the fix, though, because the player settings and the place the file is hosted decide whether the browser fetches the audio before anyone asks for it.
This guide covers which format to use, how to add audio in WordPress and in plain HTML, what SoundCloud and Spotify embeds add to a page, where to host the files, and how to check that the page didn’t get slower.
Which Format to Use
Three formats cover almost every website: MP3, AAC and Opus. MP3 plays in every browser and every WordPress player, AAC (usually saved as .m4a) gives the same quality as MP3 at a lower bitrate, and Opus produces the smallest files of the three, particularly for speech. The bitrates below are starting points taken from the Opus specification and MDN’s audio codec guide, and it’s worth listening to a test file before converting a whole library.
| Format | Voice and podcasts | Music | Browser support |
|---|---|---|---|
| MP3 | 64 to 96 kbps mono | 128 to 192 kbps stereo | All browsers |
| AAC (.m4a) | 48 to 64 kbps mono | 96 to 128 kbps stereo | All modern browsers |
| Opus (.opus / .ogg) | 28 to 40 kbps mono | 96 to 128 kbps stereo | Chrome / Firefox / Edge / Safari 18.4 and later |
Speech should be saved in mono, since a second channel carries the same voice twice and roughly doubles the file size for no audible gain. For sample rate, 48 kHz suits Opus and most voice recordings, while music mastered at 44.1 kHz should stay at 44.1 kHz, because converting it upwards adds data without improving the sound. WAV doesn’t appear in the table because it’s an uncompressed format meant for editing, and serving it to visitors means sending ten times more data than an MP3 of the same recording.
Opus used to be held back by Safari, but Apple added Ogg Opus playback in Safari 18.4, so current iPhones, iPads and Macs play it. Older Apple devices that haven’t updated still can’t, which is why an Opus file should come with an MP3 fallback on sites with a broad audience. WordPress users should know that the standard Audio block accepts only one file, so the practical choice there is MP3 unless you add the player with custom HTML, which is covered further down.
Converting the File
Convertio runs in the browser and handles more than 60 audio formats, including MP3, AAC, M4A and Opus, so there’s nothing to install and no account to create for single files. The process takes a few minutes:
- Upload the WAV from your computer, Google Drive or Dropbox, or paste a link to the file.
- Pick the output format. If you’re following the fallback approach, add the same file twice and set one to Opus and the other to MP3, since Convertio converts several files in one batch.
- Open the settings icon next to each file and set the bitrate, sample rate and channels to match the table above. The defaults usually keep the source’s stereo channels and a higher bitrate than a voice recording needs, so this step is where most of the size saving comes from.
- Click Convert and download the results.
Convertio deletes uploaded files once the conversion finishes and removes the converted files after 24 hours, so it’s a conversion step only, and the finished files still need a permanent home on your site or a storage service. The free tier’s maximum file size has changed over time, so check the limit shown on the upload screen before sending a long recording.
For a large back catalogue, a command-line tool is faster than uploading files one batch at a time. FFmpeg converts a voice recording to mono Opus and MP3 with two commands:
ffmpeg -i episode.wav -ac 1 -c:a libopus -b:a 32k episode.opus
ffmpeg -i episode.wav -ac 1 -c:a libmp3lame -b:a 64k episode.mp3Adding Audio in WordPress
In the block editor, click the plus icon where the player should go and add an Audio block. It gives you three ways to add a file: Upload sends it from your computer to the Media Library, Media Library reuses a file you’ve already uploaded, and Insert from URL points the player at a file hosted somewhere else, such as object storage or a CDN. Leave the Autoplay toggle in the block settings switched off for the reasons covered in the HTML section below.
Set Preload to None or Metadata
The Preload option in the block’s settings sidebar decides how much of the file the browser fetches before anyone presses play, and it has the biggest effect on page load of any setting in the block. None fetches nothing until play is pressed and suits most pages, while Metadata fetches only the duration and basic file details, which is useful if you want the player to show the length upfront. Auto can download the entire file as the page loads, and Browser default leaves the decision to each browser, so neither belongs on a page where most visitors won’t press play. Preload is treated as a hint rather than a strict rule, but None and Metadata reliably keep the initial download small in current browsers.
Check Your Upload Limit
WordPress doesn’t have a fixed upload limit of its own. It takes the smaller of two PHP settings on your server, upload_max_filesize and post_max_size, so the limit can be 2 MB on one host and several hundred MB on another, and you can see yours under Media, Add New Media File. If a WAV fails to upload, raising those PHP settings will get it into the Media Library, but every visitor who plays it will still download the full file, which is why converting first solves both problems at once.
The block plays one file per player, so the Opus file with an MP3 fallback needs a Custom HTML block holding the code from the next section. The same applies to playlists, where a player plugin is the simpler option, although most add their own scripts and styles to every page, so it’s worth checking the page weight before and after installing one.
Adding Audio With HTML
On a hand-coded site, or in a WordPress Custom HTML block, the <audio> element handles playback without any extra scripts. Listing the Opus file first and the MP3 second lets each browser play the first format it supports, and the preload attribute works the same way as the WordPress setting above.
<audio controls preload="none">
<source src="/audio/episode.opus" type="audio/ogg; codecs=opus">
<source src="/audio/episode.mp3" type="audio/mpeg">
<a href="/audio/episode.mp3">Download the episode (MP3)</a>
</audio>The <audio> tag itself shouldn’t carry a src attribute in this setup, because browsers use it in place of the <source> list and the fallback stops working. The download link inside the tag only shows on browsers that can’t play either file. If the recording is speech, add a transcript below the player, since search engines can’t index what’s said in an audio file and a transcript gives the page text that matches what people search for.
A page with a list of episodes needs a different approach, because ten players with preload="none" still give the browser ten file addresses it may decide to check. Leaving the file address out of the markup until someone clicks guarantees that nothing downloads early:
<button class="play-audio" data-src="/audio/episode-12.mp3">Play episode 12</button>
<script>
document.querySelectorAll('.play-audio').forEach(button => {
button.addEventListener('click', () => {
const player = document.createElement('audio');
player.controls = true;
player.src = button.dataset.src;
button.replaceWith(player);
player.play();
});
});
</script>Background music that starts on its own is the one setup worth avoiding entirely. Chrome, Firefox and Safari block audible autoplay until the visitor has interacted with the page, so the music often doesn’t start anyway, and when the autoplay attribute is present the browser downloads the file as the page loads regardless of the preload setting. Audio that plays automatically for more than three seconds also has to come with a pause or volume control to meet WCAG’s audio control requirement, so a visible player the visitor starts themselves is both faster and simpler.
Embedding From SoundCloud, Spotify or YouTube
Hosting a recording on SoundCloud, Spotify or YouTube and pasting the embed code into your page is the most common way to add audio, and it has real advantages. The platform handles storage and bandwidth, and listeners can follow or subscribe from the player. The cost shows up in page weight, because each embed is an iframe that loads the platform’s player, scripts and tracking code as soon as the page opens, before anyone presses play. A single YouTube embed transfers more than 500 KB of scripts according to the developers of lite-youtube-embed, and SoundCloud and Spotify players follow the same pattern, so a page with three embedded episodes can end up heavier than the audio files themselves.
Adding loading="lazy" to the iframe tag stops the browser from loading embeds that sit further down the page until the visitor scrolls near them, which helps when the player isn’t in the first screen. For embeds near the top of the page, a facade works better. The page shows a static image of the player with a play button, and the real iframe only loads when someone clicks it. lite-youtube-embed does this for YouTube, and the same idea works for SoundCloud and Spotify with a short click handler like the one in the previous section. We covered the same problem for video in this guide.
Website builders such as Wix and Squarespace have their own audio elements, which work like the WordPress block without the preload setting. Most accept only MP3 or a short list of formats and cap the upload size, so converting the recording to MP3 first is the main thing a builder user can control.
Where to Host the Files
For a handful of clips, uploading the files to the same hosting account as the site is the simplest option, and it works on any plan. The limits appear as the library grows. Shared hosting plans advertised as unlimited are meant for files that belong to the website, and several providers draw a line at using the account as media storage. HostGator and Bluehost both exclude media storage from shared hosting space in their terms, DreamHost’s unlimited policy rules out sites whose main purpose is distributing files, and GreenGeeks names excessive audio and video storage as something it may step in over. A few voice clips on a business site won’t trigger any of these, but a podcast archive with years of episodes is exactly the kind of use they describe. Popular episodes also use up transfer allowance quickly, which we covered here.
Object Storage With a CDN
A larger library is better kept in object storage such as Cloudflare R2, Backblaze B2 or Amazon S3, with a CDN serving the files from locations close to each listener. R2 doesn’t charge for outbound transfer, which suits audio well, because transfer rather than storage is usually the main cost of serving it. The site links to each file by its URL, so WordPress users add it through the Audio block’s Insert from URL option and nothing goes into the Media Library. Including a version number in each file name, such as episode-12-v2.mp3, lets the CDN cache the file for a year and still serve the new one if you replace it later.
A Podcast Host
If the audio is a podcast, a dedicated host such as Buzzsprout, Transistor or Libsyn handles storage and delivery, and it also generates the RSS feed that Apple Podcasts and Spotify need, which neither of the options above does on its own. You get download statistics as well, and the episodes appear on your site through the host’s embedded player, which brings the iframe cost described in the previous section and the same fixes for it.
Checking That the Page Didn’t Get Slower
Chrome’s developer tools show exactly what the page downloads, so the check takes a couple of minutes:
- Open the page and press F12, or right-click and choose Inspect.
- Go to the Network tab, tick Disable cache, and click the Media filter so only audio and video requests are listed.
- Reload the page without touching the player.
With Preload set to None, or with the click-to-load setup, the Media list should stay empty after the reload. Metadata shows a single small request for the start of the file, usually a few kilobytes. If the list shows a request the size of the whole file, something is overriding the setting, typically an autoplay attribute, a player plugin with its own preload option, or a caching or optimisation plugin rewriting the player’s markup.
Press play afterwards and the full request should appear, starting within a second or two on a normal connection. If it takes noticeably longer, the file is too large for the bitrate it needs or the server is slow to deliver it, which points back to the format and hosting choices above. Running the page through PageSpeed Insights before and after adding the player gives the same comparison in terms of load time and Core Web Vitals, and the two scores should be within a few points of each other when the audio is set up correctly.
Which Palworld server should you buy?
The 1.0 map just doubled and 72 new Pals dropped. Answer five quick questions and we'll match you with the right host for your group.