forked from mohayonao/web-audio-engine
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Did you guys manage to find or create a decoder for MP3?
I tried using https://www.npmjs.com/package/audio-decode
I integrated the decoder this way:
const decodeMP3 = async file => {
const buffer = await decode(file)
const data = {
"numberOfChannels": buffer.numberOfChannels,
"length": buffer.length,
"sampleRate": buffer.sampleRate,
"channelData": Array.from({ "length": buffer.numberOfChannels },
(_, ch) => buffer.getChannelData(ch))
}
return data
}
decoder.set("mp3", decodeMP3)
decoder.set("m4a", decodeMP3)
But I am receiving the following error:
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert(
audioBus.audioData.numberOfChannels === this.audioData.numberOfChannels,
)
...
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '=='
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels