I use a WYSIWYG tool to design my web pages, I want to change the part that handles sound to html5 so it will work better on another platform I want to use.

I have looked at the code my editor made, this looks like the bit that needs changing to me, I think its all there, all my web pages use the same technique/code to add sound, the only variant is that some use looping sound for some pages, so that also needs to be in mind.

<embed id = backmusic src="./media/explosion.wav" autostart="true" width="1" height="1" loop="false"></embed>
<noembed> <bgsound src="./media/explosion.wav" loop=false> </noembed>

Could someone show me what the code be if this was html5?
Thank you for help offered.

Recommended Answers

All 4 Replies

<audio src="source of file" autoplay>

    Non html5 here

</audio>

I believe that is the syntax

Thank you for your answer
So do I put

<noembed> <bgsound src="./media/explosion.wav" loop=false> </noembed>

where you have it marked at
3. Non html5 here
That way I can say if its looped or not? Strange, I thought the code for looping or just playing once would also be written in html5 as well.

this works but the looping doesnt work

<audio controls="controls" autoplay="autoplay"> loop="loop">
<source src="./media/explosion.wav" type="audio/wav" />
</audio>

Look at your syntax. You included an extra >.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.