OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

html audio fetch more data on request

  • Thread starter Thread starter Anton Danilov
  • Start date Start date
A

Anton Danilov

Guest
I have a problem with html audio element.
Server returns only part of audio file(wav) per request, because it needs some time to generate file and returns only part of it while create in progress, so i need more than one to get full wav file.

It also returns headers like:
Content-Type: audio/wav
Content-Length: length of chunk

My frontend looks like this:

Code:
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Streaming Audio</title>
</head>
<body>
<div>
    <h5>Download file</h5>
    <div class="audio-div">
        <audio controls preload="none">
            <source src="/read" type="audio/wav">
        </audio>
    </div>
</div>
</body>
</html>

Now it's play only first chunk of audio file, is there any ways to fetch more data to first chunk of audio?

<p>I have a problem with html audio element.<br />
Server returns only part of audio file(wav) per request, because it needs some time to generate file and returns only part of it while create in progress, so i need more than one to get full wav file.</p>
<p>It also returns headers like:<br />
Content-Type: audio/wav<br />
Content-Length: <em>length of chunk</em></p>
<p>My frontend looks like this:</p>
<pre><code><!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Streaming Audio</title>
</head>
<body>
<div>
<h5>Download file</h5>
<div class="audio-div">
<audio controls preload="none">
<source src="/read" type="audio/wav">
</audio>
</div>
</div>
</body>
</html>
</code></pre>
<p>Now it's play only first chunk of audio file, is there any ways to fetch more data to first chunk of audio?</p>
 

Latest posts

B
Replies
0
Views
1
Blundering Ecologist
B
Top