Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Audio | Advanced Concepts
Introduction to HTML

book
Audio

The audio element in HTML allows you to embed audio files on a web page. Its functionality is quite similar to that of the video element. They also share most of the attributes. The only difference is that of their name and the media they serve.

html

index.html

copy
<!DOCTYPE html>
<html>
<head> </head>
<body>
<audio src="https://codefinity-content-media.s3.eu-west-1.amazonaws.com/project+courses+folder/audio.mp3" controls></audio>
</body>
</html>

You can also use the source element to specify multiple versions of the audio in different formats, and the browser will choose the appropriate version based on the device's capabilities.

html

index.html

copy
<!DOCTYPE html>
<html>
<head> </head>
<body>
<audio controls>
<source src="audio.mp3" type="audio/mp3" />
<source src="audio.ogg" type="audio/ogg" />
<source src="audio.wav" type="audio/wav" />
</audio>
</body>
</html>

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 5. Capítulo 7

Pergunte à IA

expand
ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

some-alt