Fix sound capture
This commit is contained in:
parent
d49d94895e
commit
5358fc2797
@ -544,13 +544,14 @@ function draw() {
|
|||||||
// build a new copy of the recording to store on the shape object
|
// build a new copy of the recording to store on the shape object
|
||||||
let soundBlob = recording.getBlob();
|
let soundBlob = recording.getBlob();
|
||||||
let data = new p5.File(soundBlob);
|
let data = new p5.File(soundBlob);
|
||||||
let recordedSound = new p5.SoundFile(data, function() {
|
let sound = new p5.SoundFile(data, function() {
|
||||||
amplitude = recording.getPeaks(1)[0] * 100;
|
let amp = sound.getPeaks(1)[0] * 100;
|
||||||
duration = recording.duration();
|
let dur = sound.duration();
|
||||||
let newShape = new GeneratedShape(recordedSound, amplitude, duration);
|
let shape = new GeneratedShape(sound, amp, dur);
|
||||||
shapes.push(newShape);
|
shape.sound();
|
||||||
newSoundJustRecorded = false;
|
shapes.push(shape);
|
||||||
sendToArchive();
|
sendToArchive();
|
||||||
|
newSoundJustRecorded = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user