2. Audio elements such as music, sound effects, or sound bites
can be added to your web page. HTML 5 provides a quick and
very easy way of inserting audio into your web page compared
to its earlier versions. MP3, OGG and WAV are audio formats
which are compatible with HTML 5. An audio format is a file
format for storing studio. The difference between formats has
something to do with file size and sound quality.
3. Audio tags will enable you to add audio in your HTML. To use
audio, include the <audio></audio> tag and a file path or the URL to the
audio file, similar as to how you place videos. Audio and video have
similar controls. Below is the sample syntax:
TIPS AND TRICKS: It is advisable to use a short clip such as a sound effect.
Many web visitors do not prefer automatic sound playing and prefer to have
control over what is being played.
4. Popular browsers support three primary types of audio files: MP3, OGG, and
WAV. Since not every browser supports every audio file format, the best choice
when it comes to compatibility is MP3. To ensure that the audio will play on most
browsers and devices, the source attribute can be used to include multiple formats.
Sample Codes and Output:
5. TIPS AND TRICKS: Free audio files can be found on the
internet wherein its royalty and copyright are free. Try
http://flashkit.com/loops/ . This offers sound effects for
projects which are useful resources for learners and for
developers. In operating systems like Windows, there is
already a sound recorder that allows you to record WAV
files.