add save() and saveBlob() methods to SoundFile. Move .wav conversion to helpers.js#315
Merged
therewasaguy merged 2 commits intoprocessing:masterfrom Aug 18, 2018
Merged
Conversation
Contributor
|
I think most of the users have the needs of sound preview, sound synthesis or wave visualization. so I think we need the blob url for preview sound, and the blob object to manipulate sound:
getBlob() p5.SoundFile.prototype.getBlob = function() {
const dataView = convertToWav(this.buffer);
return new Blob([dataView], { type: 'audio/wav' })
}getBlobUrl() p5.SoundFile.prototype.getBlobUrl = function() {
const dataView = convertToWav(this.buffer);
const audioBlob = new Blob([dataView], { type: 'audio/wav' });
return URL.createObjectURL(audioBlob);
} |
Member
Author
|
Thank you @wahengchang! I like |
814261e to
35e93c9
Compare
35e93c9 to
fce9dac
Compare
Contributor
|
agree, |
Merged
mrjoshida
pushed a commit
to mrjoshida/p5.js-sound
that referenced
this pull request
Sep 30, 2018
* 'master' of ssh://github.com/mrjoshida/p5.js-sound: rebuild lib dispose of ConvolverNode before resetting buffer (processing#321) rebuild lib with reference example fix processing#320 move loadSound call to preload prevent crashes during completion of callbacks on disposed SoundFiles 0.3.9 add soundfile.save example add `save()` and `getBlob()` methods to SoundFile. Move .wav conversion to helpers.js (processing#315) Added saveSoundToBlob() to soundRecorder.js Document properties of AudioIn update master limiter - sharp knee monosynth: remove unused _isOn monosynth: remove unused filter, patch velocity Missed this fragment during the renaming corrected formatting by replacing tabs with four spaces fixed issue: processing/p5.js-sound#297
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
saveandsaveBlobmethod to SoundFilesaveSoundmethod (it was listed under p5.SoundRecorder but is actually part of p5.prototype)saveBlobmethod can probably replace the globalsaveSoundAsBlobadded in Added saveSoundToBlob() to soundRecorder.js #312 —@wahengchang does this sound like a good approach to you?