Skip to content

Commit 147d826

Browse files
authored
replacement of es5 functions to es6 classes feat p5.soundFile (#531)
1 parent 6c54c28 commit 147d826

File tree

3 files changed

+1741
-1741
lines changed

3 files changed

+1741
-1741
lines changed

src/app.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ p5.prototype.freqToMidi = freqToMidi;
1313
import './errorHandler';
1414
import './audioWorklet';
1515
import './panner';
16-
import './soundfile';
16+
17+
import SoundFile, { loadSound } from './soundfile';
18+
p5.SoundFile = SoundFile;
19+
p5.prototype.loadSound = loadSound;
20+
// register preload handling of loadSound
21+
p5.prototype.registerPreloadMethod('loadSound', p5.prototype);
1722

1823
import Amplitude from './amplitude';
1924
p5.Amplitude = Amplitude;

src/panner.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,5 @@ if (typeof ac.createStereoPanner !== 'undefined') {
100100
}
101101
};
102102
}
103+
104+
export default p5.Panner;

0 commit comments

Comments
 (0)