const headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36',
}
headers['range'] = `bytes=${67638}-${91638920}`
const stream = await axios.get(url, {
responseType: 'stream',
headers,
}).then(s => {
return s.data;
});
response.writeHead(206, {
'Content-Type': 'audio/mpeg',
'Accept-Ranges': 'bytes',
'Content-Range': 'bytes ' + 67638 + '-' + 91638920 + '/' + 91638921,
'Content-Length': 91638921,
});
stream.pipe(response);
I want to get the streaming part of an audio file. The result I want. I paste the address into the browser and the audio player opens and playback starts, but not from the first second For example, from 10 sec. That is, the player slider should be immediately at 10 seconds