Is it possible to open a sound file?

First, some context: I am a complete newb w.r.t. Git-anything, and not a programmer. I am trying to port some plain vanilla HTML pages (from a dead server), which contain stuff like this:

     You can hear this in the word <a href=“001.mp3”>elephant</a>

and when the reader clicks “elephant”, it plays the mp3 file (or at least does what the browser is set to do with an mp3 file). I can’t figure out if there is any translation into Markdown that does this. The following does not work as desired:

You can hear this in the word elephant

This sends the end user to a separate page where they can click a download button or view raw, which will then play the file. Is there a way to cut out some steps, such as directly open the player without the intermediate page; or even, play it in the background or a second tab, while still displaying the main page? (End users will have minimal experience with computers, so simplicity is essential).

Thanks, Dave Odden

Since the MP3 files are in your repository already, you don’t have to link to them via the link. You can link to them directly via your Pages site like this:


That /001.mp3 will be resolved as, which when clicked will play the file in the web browser’s media player. You can click the link in the previous sentence to see it work :grinning:

(The reason why the link doesn’t work the way you want is because we only enable linking of certain file types and force download of all others, such as MP3s, from

My current question relates to this earlier question. My goal is to create a page where users can click on and listen to word recordings (similar to My earlier strategy was to use an html anchor (<a href=“002.mp3”>play</a>"), but probably most users (no-tech) will be using phones and this won’t usually or ever work, since browsers will at best offer to download the file. I somewhat sorted out how to use HTML5 and Java to play sounds, and a simple example is at It works if I open it locally on my computer.

I tried to open the same thing via, and it displays correctly, but it does not play.  The code inside that file is

click <audio id="ID004" source src="004.mp3"></audio><button onclick="playAudio('ID004')" type="button">play4</button> and then <audio id="ID003" source src="003.mp3"></audio><button onclick="playAudio('ID003')" type="button">play3</button>
function playAudio(audio_element) {
	var x = document.getElementById(audio_element);;

I’m trying to figure out why it won’t work. One possible answer is that I’m trying to do something forbidden, and I should stop trying. :mansad: Another thing that I thought of is that I just don’t understand how this html preview thing works, and I’m thinking about this the wrong way. If anyone has any suggestions, that would be highly appreciated.

Since this is an extension of the original question, it should just be another post on the same topic so that people can get all the details. I’ve gone ahead and merged the topics for you :grinning:

Well, never mind. It turns out that if I just open, there’s no need for an HTML preview prefix, and the page works as it’s supposed to. seems to have the same stuff as, but it’s treated differently (as a web page).

1 Like


  • #404

  • #NotAvailable

  • #PageNotFound

Please update link to solution

I dunno if I can rescind a “solution”. At some later point, the system changed and now it does not work. I suspect the code relied on an unofficial Java quirk. So it doesn’t work anymore, and I’ve abandoned the project for a while.

Could anyone help me out w/ this? I’m a very amateur coder looking to create my own little soundboard.

I have the “daft” file as an mp3 on my desktop, but can’t get it onto my website. any help is welcomed! Thanks so much!

<audio controls>
<source src=“daft.mp3” type=“audio/mpeg”>

I found a way to play audio in github pages


<!--This Way Must let Repository Public-->
var audio = new Audio("")