I would like to obtain a link to an mp3 hosted in Google Drive that has the format filename.mp3, so I can link to it from sites that provide in-line audio players when linking to mp3 files.

I have searched the web and different SE sites, but the closest thing to a solution I have found is obtaining a direct download link for the file or advice on hosting it elsewhere. However, for (future) convenience I would prefer to host and link directly from / to Google Drive.

Can anyone provide some insight or point out why this might not work?

up vote 6 down vote accepted

Yes, it is possible.

  1. First, change the directory permission to public in which your mp3 files reside.

  2. Copy the folder ID, that will be at the end of URL when you are inside the directory. It will be something like this

    0C2QKl-TsV6cVTE7wbWNOelRiRlk
    
  3. Next you can access the mp3 files using hosted mode:

    https://googledrive.com/host/0C2QKl-TsV6cVTE7wbWNOelRiRlk/filename.mp3
    

Note that the beginning part of the URL changes to https://googledrive.com/host/ for hosted mode compared to "normal" shared link mode URL https://drive.google.com/open?id=.

  • Thank you, Baljeet! This comes very close to what I had in mind. Do you know whether there is any way in which this procedure can be altered so the directory permission does not need to be set to "Public", but can instead be set to "Anyone with the link" while maintaining full functionality? – nholtappels Jul 27 '14 at 15:02
  • 1
    @nholtappels I think currently this is the only way – mbaljeetsingh Jul 27 '14 at 15:51
  • Unfortunately I don't think this works anymore. I made my folder public but this is the url i get https://drive.google.com/open?id=0B0GRVvnH21RdT3MwQ3lzN3Vjdnc&authuser=0 and my filename inside it is intro.wav – JGallardo May 27 '15 at 10:35
  • It does work. @JGallardo you must use the googldrive.com/host url instead of the url it gives you when you click share – Tim Castelijns Dec 15 '15 at 11:10
  • 3
    This answer is outdated. googledrive.com/host has been deprecated as of August 31st 2016 and no longer works. – browly Jan 25 '17 at 22:45

Don't know if this still helps anybody, but this can be done. With an “anybody with the link can view the file” link:

  • prefix the file ID with uc?id= and append it with &export=download

So it would look like this:

https://docs.google.com/uc?id=FILE-ID&export=download

If you share an MP3 by link, you obtain a link like this

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

where XXXXXXXXXXXXXXXXXX is the ID of your MP3 file. Then you can obtain a direct link to this audio by

http://docs.google.com/uc?export=open&id=XXXXXXXXXXXXXXXXXX

In particular you can use

<audio controls>
   <source src="http://docs.google.com/uc?export=open&id=XXXXXXXXXXXXXXXXXX" type="audio/mp3">
   <p>Your browser does not support HTML5 audio :(</p>
</audio> 

I researched this topic today for about an hour. As of recently (i.e. 2015/05), I also don't believe it's possible any more, but I'd love to be proved wrong.

References

  • I edited the answer on 5/26/2016. I did not know that there is a hosted mode for Google Drive. Note that the beginning part of the URL changes to https://googledrive.com/host/ for hosted mode compared to "normal" shared link mode URL https://drive.google.com/open?id=. – Greg May 26 '16 at 11:07

This example works:

<audio controls="">
   <source src="http://docs.google.com/uc?export=open&amp;id=1uZd99P8_xWM3fYsoSl4xHa8md2MWHa68" type="audio/mp3"></source>
   Your browser does not support HTML5 audio <br />

</audio>

I had the same issue and got it work with the following URL:

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

  • Can you flesh this out a little bit more? I'm not sure anyone will want to click on a random link. – jonsca Jan 26 '17 at 0:28

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.