Open kristoferhagbard opened 7 years ago
hey @kristoferhagbard apologies, it looks like we need to update those examples to match the latest version of heavy.
You should be able to just call fillTableWithFloatBuffer
and pass table name (string) and the audio buffer (Float32Array).
fillTableWithFloatBuffer = function(tableName, buffer)
created an issue for that here: https://github.com/enzienaudio/heavy/issues/198
Hi!
Thanks for quick reply!
I didn't quite get how to replace the getTableForName with fillTableWithFloatBuffer in the code below (from the example):
// Sample loading
function loadAudio(url) {
var rq = new XMLHttpRequest();
rq.open("GET", url, true);
rq.responseType = "arraybuffer";
rq.send();
rq.onload = function() {
var audioData = rq.response;
webAudioContext.decodeAudioData(audioData, function(buffer){
var testTable = testSample123.getTableForName("test");
testTable.setBufferWithData(buffer.getChannelData(0));
testSample123.sendFloatToReceiver("table-size", testTable.length);
});
}
}
Something like:
rq.onload = function() {
var audioData = rq.response;
webAudioContext.decodeAudioData(audioData, function(buffer){
heavyLib.fillTableWithFloatBuffer("test", buffer.getChannelData(0));
});
}
should work, can't remember if decodeAudioData
provides a Float32Array or not.
Thank you so much! this makes it possible to load samples! :-)
Hi,
Unfortunately, this does not work anymore. Is there any chance you could give me a hint how to get it working again while the site is still up? (very sad to hear you are closing! any chance of an OS continuation?)
Trying to use the js-loading-samples example from github examples, but after recompiling and making the appropriate changes in index.html (adding the loadAudio function) I'm getting "getTableForName is not a function".
Looking closer at the compiled .js the getTableForName is missing. (but It does exist in the precompiled .js supplied with the github example, presumably compiled in an earlier version )