Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loading mp3 file #59

Closed
shahraship opened this issue Feb 4, 2024 · 1 comment · Fixed by #62
Closed

loading mp3 file #59

shahraship opened this issue Feb 4, 2024 · 1 comment · Fixed by #62

Comments

@shahraship
Copy link

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
Copy link
Owner

danigb commented Feb 4, 2024

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" }); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants