Want to request only half of the audio file but not working

i request an audio file from my server and stream it to the browser .. on the browser i make a request to get only half of the audio file stream (i am doing total size of the file / 2 bytes) using the range header in request. the response header is something like this
Content-Range: bytes 0-5510814/11021629;
Content-Range: bytes 0-5510814/11021629;
but in the html <audio /> element i am getting the total duration of the audio as the original length of the file not the half of it i also tried to manipulate the total size of the file in the response header but still it shows the full length but the actual available audio is correct (i.e half of the original audio file)
5 Replies
Aland
Aland15mo ago
Why not split the audio file into 2 parts?
fero.xd
fero.xd15mo ago
Thats not what i want actually
Huperniketes
Huperniketes15mo ago
The server code has to parse and comply with the range spec.
fero.xd
fero.xd15mo ago
Didthat
Huperniketes
Huperniketes15mo ago
Then hard code the filename and half its duration for the playback. Make sure that works. Start playback at the quarter file mark and play 10 seconds.
Want results from more Discord servers?
Add your server
More Posts