magenta / magenta-js

Magenta.js: Music and Art Generation with Machine Learning in the browser
https://magenta.tensorflow.org
Apache License 2.0
1.96k stars 311 forks source link

Player class doesn't contain AudioBuffer #544

Open marcoaccardi opened 3 years ago

marcoaccardi commented 3 years ago
const mvae = require('@magenta/music/node/music_vae');
const core = require('@magenta/music/node/core');

const player = new core.Player()
const model = new mvae.MusicVAE('https://storage.googleapis.com/magentadata/js/checkpoints/music_vae/mel_2bar_small');

model
  .initialize()
  .then(() => model.sample(1))
  .then(samples => {
    player.resumeContext();
    player.start(samples[0])
  });

I've tried to start off with Magenta and NodeJS, but when I run the script I receive the following error:

ReferenceError: AudioBuffer is not defined

I understand that the issue might be caused by the fact that there is no WebAudio API in the node environment. How can I solve it?

notwaldorf commented 3 years ago

cc @cannoneyed

timothywangdev commented 3 years ago

same error

riaan53 commented 3 years ago

@marcoaccardi Hi, did you manage to solve this error?

jbeyta commented 1 year ago

Here is some info on this:

https://stackoverflow.com/questions/67474153/referenceerror-audiobuffer-is-not-defined#:~:text=The%20error%20you%20are%20getting,if%20window%20object%20is%20defined.