How does the <audio> tag work? And can a file be hosted on Google Drive?

The title says most of it. I can’t find a single good example online for the tag. I have an mp3 file and tried hosting it on Google Drive. I’ve seen two ways to use the tag and neither has worked. Any tips?

Edit: I want the controls off, autoplay (and preload, if necessary) on. As I said before, it’s an mp3 file.

I think the link is broken somehow…and do I need to have it as an OGG file too?

No was an example

thank you!! that was very helpful

1 Like

Can i see your code, or did you get it to work? Only the mp3 file should work, but having a ogg backup isn’t bad.

The code’s here. It (the audio) doesn’t work yet…
Thank you!

Code looks fine to me (checked audio code ) but your link to music isn’t right…

When I went to the Google Drive link it was an empty folder…

Hmmm…I thought I knew how to fix that. I did not. Would I be able to link it from soundcloud?

Any link should work just that shouldn’t be private

It isn’t private, I set it so anyone can view it. The first time it was on my school google drive for various reasons instead of my personal so i copied the file to my personal and thought it would work…it didn’t. slightly updated code here.
I tried turning on the controls at one point just to see what would happen and it’s perpetually muted or something…is there any way to change that with jQuery or CSS?

You url should end at .mp3 or .ogg, google drive seems to be doing something to the file so you can play it in browser, we don’t want this, even google drive can’t play the item, can you upload the mp3 file somewhere else?

You cold probably host it on a dropbox free account

You have to add the raw=1 param to the end.


Let us know if it works.

1 Like

It worked on soundcloud, but thank you so much for the suggestion! I may need it in the future:)

I uploaded it to soundcloud and it worked. thank you so much!!