We can define or specify the type of media file (audio, video, etc) in HTML by the <source> tag. It defines the multimedia resources and gives the browser multiple and alternative types of that media file from which the browser can choose according to its compatibility with that media type.
Note: Browser chooses the first media type that it supports from the given types.
<source src="<media_file>.<media_file_extension>" type="<media_type>">
In this exampl two source tags are included for two types of an audio file, i.e. ‘wav‘ and ‘mp3‘. If the browser supports wav audio files, it will play the audio from that source only, if not it will check for the next given option which is the mp3 audio type.
If none of the audio types is compatible with the browser, no audio source is selected. Otherwise, the first audio type in the order will get selected as the audio source. And, the type is the attribute that defines the resource type.