loading mp3 file
Closed this issue · 1 comments
shahraship commented
This example doesn't seem right:
const sampler = new Sampler(audioContext, { duh: "duh-duh-ah.mp3" }); sampler.start({ note: "duh" loop: true loopStart: 1.0, loopEnd: 9.0, });
It's throwing this error: Object literal may only specify known properties, and 'duh' does not exist in type 'Partial'.ts(2353)
I've an MP3 file I would like to know how I can load it.
danigb commented
I think is a problem with the documentation: you need to pass the file url inside a buffers object:
// this works
const sampler = new Sampler(audioContext, { buffers: { duh: "duh-duh-ah.mp3" }});
// this doesn't work
const sampler = new Sampler(audioContext, { duh: "duh-duh-ah.mp3" });