About audio element | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

About audio element

I have a question, if I want to add only one audio type, do I write <audio src="example.mp3" type="audio/mpeg"> or do I type <audio src="example.mp3">, is the type attribute needed? Or do I only use it when I add more than one audio types using the <source> element?

6th Jul 2020, 4:56 PM
Karak10
Karak10 - avatar
1 Answer
+ 13
Karak10 Type isn't necessary, look at this: <audio src="https://dl.dropbox.com/s/c6aq63o2mwuvkui/Happy-Birthday-to-you-Singing-Bell.mp3" controls> Audio Element </audio>
7th Jul 2020, 12:21 AM
Simba
Simba - avatar