Closed MaxKaye closed 8 years ago
Make sure you do your backtics on a new line by themselves.
Try changing the type
to audio/mpeg
.
Thank you, I tried but still doesn't function `
You changed other aspects of your HTML. Leave it the way it was and change just one thing at a time. Then, once you get it working, change the HTML to be as you want it. Otherwise there are too many things going on to tell what the problem is.
Also, make sure you don't put spaces around the =
in HTML attributes.
For example, this is fine:
<div class="hello"></div>
This could cause errors:
<div class = "hello"></div>
Noted. here were the first two changes you suggested- is this accurate?
<audio id="ni" src="niaudio.mp3" type="audio/mpeg">
<div>
<button onclick="document.getElementById('ni').play()">Play the Audio</button>
<button onclick="document.getElementById('ni').volume+=0.1">Increase Volume</button>
<button onclick="document.getElementById('ni').volume-=0.1">Decrease Volume</button>
</div>
</audio>
Almost. <div>
shouldn't go inside <audio>
. The only thing allowed inside is <source>
.
If it's still not working, can you confirm whether the file plays when you load it in iTunes and/or Quicktime?
still not working- and yes the mp3 files work when I play in ITunes
Here is what it looks like rn:
Hm. Well, the crossed-out speaker means it's not loading the audio at all. I'll come take a look.
Thank you!
I am trying to add audio files so user can hear pronunciation of the word. I have tried the following things and haven't gotten to work yet:
inline to html:
and also added getElementByID. Any suggestions?