How to embed Google Drive Audio in HTML Audio Tag

 · 3 min read  ·

Update, July 2026: this method no longer works. In January 2024, Google started blocking Google Drive files from being embedded on other websites. Any request coming from a site other than Google's own now gets a 403 error instead of the audio, so the player never loads (you'll see a CORB or ORB message in the browser console). Nothing you change in the HTML will fix it. The block happens on Google's servers. I'm keeping the original steps below for reference, but if you need to embed audio today, host the MP3 somewhere else, like your own server, a public GitHub repo (use the raw.githubusercontent.com link), or object storage like Cloudflare R2.
There may be times where you want to create an HTML audio tag but instead of storing the MP3 on your server, you want to reference it out of your Google Drive storage. In this post, I'll show you how to do it.

Get Share Link From Google Drive MP3 File

First, in Google Drive locate your file and click on the three dots to bring up a dropdown. Then choose Share.

Choosing Share from the Google Drive file dropdown menu


Next, under General access, set to "Anyone with the link" and "Viewer."

Google Drive general access set to Anyone with the link as Viewer


And click Copy Link to get the link.

However, all you really need is the ID, which is found in the link URL. So with this example:

https://drive.google.com/file/d/13s1pwgpWZAbpwYgaFa_MgdxiKGOILCtX/view?usp=sharing

…you just need what comes after the d/ and before the /view.

So I’ll copy this ID which is 13s1pwgpWZAbpwYgaFa_MgdxiKGOILCtX

Now Create the HTML Audio Tag

Now that you have the ID of the MP3, add it to the end of this provided link (replace YOURGOOGLEMP3ID with your file’s ID that you copied above):

https://docs.google.com/uc?export=open&id=YOURGOOGLEMP3ID

And to see it in an HTML audio tag, and example would look like this:

<audio class="player" controls preload="none">
  <source src="https://docs.google.com/uc?export=open&id=13s1pwgpWZAbpwYgaFa_MgdxiKGOILCtX" type="audio/mp3" />
</audio>

This used to render as an audio component with the MP3 available to stream. Google now blocks the request (see the update at the top of this post), so the player below no longer plays:

This page may contain affiliate links. Please see my affiliate disclaimer for more info.

Related Posts

View All Posts »
How to Manage Dotfiles with GNU Stow

How to Manage Dotfiles with GNU Stow

A simple, powerful workflow for managing any Linux dotfiles with GNU Stow. This guide walks you step-by-step through setting up a clean, scalable dotfiles system using a Ghostty config as the example.