Closed jayc809 closed 2 years ago
I was trying to decode an ArrayBuffer from a local mp3 file using node but got the "Invalid ADTS header" error. Here is my code:
const webAudioApi = require("web-audio-api") const filePath = path.resolve(__dirname, 'test.mp3') const data = fs.readFileSync(filePath) const buffer = data.buffer const audioCtx = new webAudioApi.AudioContext() audioCtx.decodeAudioData(buffer, (buffer) => {console.log(buffer)})
Not really sure what the error means or why my code doesn't work (buffer is an ArrayBuffer). Thanks!
It appears to be an issue with my mp3 file
I was trying to decode an ArrayBuffer from a local mp3 file using node but got the "Invalid ADTS header" error. Here is my code:
Not really sure what the error means or why my code doesn't work (buffer is an ArrayBuffer). Thanks!