gibber-cc / gibberish

Fast, JavaScript DSP library that creates JIT optimized audio callbacks using code generation techniques
387 stars 35 forks source link

Not able to use Gibberish.Sampler() #23

Closed vasuki1996 closed 6 years ago

vasuki1996 commented 6 years ago

its giving me Gibberish.Sampler is not a constructor error. Im not able to figure out what is the issue here's the code sampler = new Gibberish.Sampler({ file: "assets/media/MOE.mp3", loops:true, playOnLoad:1, });

charlieroberts commented 6 years ago

Sorry for the delayed response... in the new (3.0) version of Gibberish you don't need to use the new keyword in front of Gibberish.Sampler, although it seems very strange that this would thrown an error. Does it work if you remove the new keyword?

charlieroberts commented 6 years ago

For example, the following code works fine in the playground:

rhodes = Sampler({
  filename:'http://charlie-roberts.com/gibberish/playground/resources/audiofiles/rhodes.wav',
  loops:true
}).connect()