Continous Integration (CI) builds status Platform Made as addon, improved and updated by Roy Macdonald. The original development branch can be found here. This is an addon version for the ofSoundObject implementation originally conceived at the 2013 OFDev Conference held at the Yamaguchi Center For Arts and Media, Japan. It is capable of reading and writing audio files. It allows to connect any sound source, process, display and output it in any way needed. An open implementation question is whether the (expanding) sample buffer of this object will be available before stopRecording() is called, or whether the internal buffer is only created once the effective size of the recording is known.OfxSoundObjects Simple yet super powerful modular sound architecture for openFrameworks. AudioRecording ain.record() starts an indefinite recording into a new AudioSample, which needs to be stopped explicitly by calling stopRecording() on the resulting AudioRecording.AudioRecording ain.record(float seconds) essentially a short-hand for creating a new AudioSample of that length and then calling as.recordFrom(ain) on it. To allow for the creation of recordings of unknown/dynamic length (like described above in this issue), one could add a new class AudioRecording extends AudioSample implements RecordingSession which is returned by the following new AudioIn methods: The nice thing about having an external interface/object for the recordings is that several recordings (even from different audio sources) can be written into the same AudioSample at the same time to create crazy mashups (and even while the AudioSample itself is being played back! In the case of one-off fixed length recordings the user can just fire and forget without keeping the RecordingSession object, since the recording will finish automatically after duration. possibly other methods for getting information about the recording duration so far/to go, extending/restarting the recording etc.void/boolean rs.stopRecording() ends an indefinite, circular recording session (or stops a fixed length recording prematurely).boolean rs.isFinished() returns false as long as the writing of samples from the source to the AudioSample is ongoing.RecordingSession is a new interface which provides a controller for the recording session. RecordingSession as.recordFromFrame(SoundObject o, int start, int nframes).RecordingSession as.recordFromFrame(SoundObject o, int start) same but with offsets specified in frame numbers.RecordingSession as.recordFrom(SoundObject o, float start, float duration) same but with a target buffer start offset.RecordingSession as.recordFrom(SoundObject o, float duration) if the duration is negative, record indefinitely into the fixed size buffer, effectively implementing Circular buffer with AudioIn #54 (not just for AudioIn but for any sound source).RecordingSession as.recordFrom(SoundObject o) fills the existing AudioSample buffer once from start to finish.Here's a rough idea for an interface that I cooked up, would be great to hear opinions on this if you're still working with this?Īssuming the user has already created a fixed length AudioSample (or SoundFile), they could record into that buffer using the following new methods: In the long run it would be great to have dedicated user friendly methods to record not just from AudioIn, but potentially any sound source. In the short term, DIY solutions can be made easier by exposing AudioIn's internal JSyn ChannelIn through a public method (documented only in the Javadoc, for advanced users).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |