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
Aland2y ago
Why not split the audio file into 2 parts?
fero.xd
fero.xdOP2y ago
Thats not what i want actually
Huperniketes
Huperniketes2y ago
The server code has to parse and comply with the range spec.
fero.xd
fero.xdOP2y ago
Didthat
Huperniketes
Huperniketes2y 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