CBSE 1. CUSTOMIZING AND EMBEDDING-MULTIMEDIA - COMPONENTS IN WEB PAGES (10 MARKS)

 

6. Embedding Audio in Web Pages

Image:

 


HTML audio tag with controls

Example:

HTML

<!DOCTYPE html>

<html>

<head>

    <title>Audio Example</title>

</head>

<body>

 

    <h1>Audio Player</h1>

 

    <audio controls>

        <source src="path/to/your/audio.mp3" type="audio/mpeg">

        Your browser does not support the audio element.

    </audio>

 

</body>

</html>

Explanation:

  • The <audio> tag is used to embed audio content in HTML5.
  • The controls attribute adds play, pause, volume, and time controls to the player.
  • The <source> tag specifies the path to the audio file and its type.
  • The text between the closing <source> tag and the closing <audio> tag is displayed if the browser doesn't support the audio element.

No comments:

Post a Comment