Skip to content

Commit

Permalink
fixed error while merging (#544)
Browse files Browse the repository at this point in the history
* decoupled helpers method from p5 in helper.js and coupled them separately in app.js

* fixed build process bug in helpers.js

* addes saveSound import in app.js
  • Loading branch information
endurance21 authored Aug 31, 2020
1 parent 117637d commit b291d88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import {
interleave,
writeUTFBytes,
safeBufferSize,

saveSound


} from './helpers';
p5.prototype.sampleRate = sampleRate;
p5.prototype.freqToMidi = freqToMidi;
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function safeBufferSize(idealBufferSize) {
* @param {String} fileName name of the resulting .wav file.
*/
// add to p5.prototype as this is used by the p5 `save()` method.
export function saveSound(soundFile, fileName) {
function saveSound(soundFile, fileName) {
const dataView = convertToWav(soundFile.buffer);
p5.prototype.writeFile([dataView], fileName, 'wav');
}
Expand Down

0 comments on commit b291d88

Please sign in to comment.