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