Html <au­dio>

Web Designer - - Awesome Audio -

The HTML <au­dio> tag al­lows you to em­bed mu­sic on web­sites and apps. Sim­i­lar to the <video> tag, you can spec­ify a source file, con­trols and sev­eral other op­tions. This al­lows you to eas­ily add au­dio to your page with min­i­mal code. You can then tar­get the el­e­ment via Javascript to give fur­ther con­trol. It sup­ports MP3, WAV, OGG and other for­mats, with MP3 be­ing uni­ver­sally sup­ported across mod­ern browsers and de­vices. A sim­ple ex­am­ple of us­ing the <au­dio> tag: <au­dio au­to­play=”au­to­play” con­trols=”con­trols”> <source src=”mu­sic.ogg” /> <source src=”mu­sic.mp3” /> </au­dio> Some handy at­tributes spe­cific to the el­e­ment in­clude: • Au­to­play – to al­low the au­dio to play once it is ready • con­trols – con­trols for the au­dio file will be in­cluded on the page • Loop – if this one is in­cluded, the au­dio will loop and play again once it has fin­ished • Preload – preload the au­dio when pos­si­ble so it’s ready for play­ing Lim­i­ta­tions to the <au­dio> el­e­ment in­clude: • Low limit to num­ber of sounds played si­mul­ta­ne­ously • No pre­cise tim­ing con­trol • No abil­ity to ap­ply real-time ef­fects • No way to an­a­lyse sounds

Newspapers in English

Newspapers from UK

© PressReader. All rights reserved.