-
Notifications
You must be signed in to change notification settings - Fork 11
Add Recorder Class #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi! 👋 It currently records in audio/webm by default. Some browsers also support audio/ogg, but unfortunately more standardized formats like WAV or MP3 aren’t supported out of the box by MediaRecorder. Here’s a working example sketch that records and downloads audio from a p5 oscillator: Would love feedback or thoughts on direction, especially if there's interest in fallback formats or alternative export options! |
hey just checked out your branch i think it's great but would be awesome to support wav and mp3, are those tricky to add? I tried exporting both by changing the filetype but doesn't seem to be supported yet. want to submit with those and i'll merge? |
@ogbabydiesal I'll search for that! As Tone.js implementation just wraps around the MediaRecorder it just supports natively |
The On the other hand,
Given this, I think it makes sense for us to implement WAV support directly within the Recorder class, since it's a lossless format and easier to manage license-wise. Users who need compressed formats like MP3 can handle conversion on their end using the tools of their choice. |
let's go with wav for right now! |
Hi @ogbabydiesal @lvdopqt ! Chiming in on how a more integrated audio/video export could work.This is pretty separate from (/additional to) the p5.Recorder implementation that mirrors tone.js use, which makes total sense. I think since you're thinking about the recording here, I wanted to share a few possible additive future possibilities for your consideration! In p5.js, the analogs of I think the above are ideas about API and usage, not implementation; underneath, it would be using Recorder class. Whatever version of Lastly, there is a community add-on library, p5.capture. Here you can see the UI for recording and the usage. It is a widely used library and seems to work out of the box with both 1.x and 2.x, and because it has many dependencies to support different formats, it would be a bigger discussion if to include it in the core. But even as a separate add-on, it's popular, and I would be happy to potentially discuss ways that the sound recording could be somehow made possible to that add-on from the sound library (sound capture is out of scope for the way that video capture works) so that from the end-user perspective, if they have both sound addon and p5 capture addon, the whole thing works as expected (saves both sound and video). That might be very difficult to achieve and likely requires overloading something from p5.capture in p5.sound itself, but if possible, would be really beginner-friendly. I think providing multiple different ways to do something like export can lead to a lot of confusion, and I don't think these should be added without consideration, but I wanted to share the research on what could be a way to do export/saving of sound in a way that looks and feels more like p5.js. Looking forward to hear what you think! |
from Tone.js Recorder class
https://tonejs.github.io/docs/15.0.4/classes/Recorder.html
The text was updated successfully, but these errors were encountered: