How to load an audio bit as I play?

Asked

Viewed 40 times

0

I have a server where I host files .wav (audio media). The problem is that these audios are very large and when I will implement a tag <audio> or <video> in my HTML, first it downloads the complete content to then play, and it ends up slowing down the application.

Is there a way that you could play this audio at download time? Or that you don’t need to download the whole audio to play it later?

<audio autoplay="autoplay" controls="controls">
    <source src="http://localhost/audios/teste.wav" type="audio/wav" />
    seu navegador não suporta HTML5
</audio>

1 answer

1


The answer would be to put the attribute "Preload" with the value "auto" in the audio tag:

<audio autoplay="autoplay" preload="auto" controls="controls">
    <source src="http://localhost/audios/teste.wav" type="audio/wav" />
    seu navegador não suporta HTML5
</audio>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.