Audio Recorder Plugin (Composition by dust)

Author: dust
License: Creative Commons Attribution-NonCommercial
Date: 2011.06.07
Compatibility: 10.5, 10.6
Categories:
Required plugins:
(none)

this plugin lets you record audio down to file. use a .caf extension. if this is useful i can open up some more variables like sample rate etc... right now its inputs are record, record path, record length, and device; you can use kineme audio tools to play the file back.

dust's picture
Re: Audio Recorder Plugin (Composition by dust)

the plugin with source

PreviewAttachmentSize
AudioRecorder Example.zip206.99 KB

monobrau's picture
Re: Audio Recorder Plugin (Composition by dust)

Hi Dust,

Looks promising, but can't get it to work. It show's up properly in the library, but doesn't save a file.

I tried 32&64 bit mode, changing from relative to full pathnames.

I'm on 10.6.5 & QC4.

dust's picture
Re: Audio Recorder Plugin (Composition by dust)

don't know what to say. the example file places an audio file in my root directory when i run it. the code is very old..... carbon old. so using a path like ~/Desktop/audioFile.caf isn't going to work.

saying /audioFile.caf should write the file to your HD. actually the open panel plugin is supposed to deal with the saved file and extensions for you, but it seems thats a bit broken as well. thanks for testing.

you can try some other formats like wav or aac remember 'aac ' has a space at the end ? the code should be able to defer the type from the extension you choose. default is .caf and i would just say use .caf as you can open it with anything.

maybe you don't have a mic plugged in. the example is set to device id 0 which is your default input normally built-in mic. you can one use kineme audio tools info to get a list of devices to check to make sure your on the right device. what may be happening is you have an aggregate device set up which becomes the default and maybe your aggregate device isn't plugged in.

so i would try just writing to your HD, and making sure the default input is set to a device that can be read from.

monobrau's picture
Re: Audio Recorder Plugin (Composition by dust)

Still no luck, I tried different formats/paths/input devices and combinations of those. I'm going to test it on a clean install when I have the chance.

dust's picture
Re: Audio Recorder Plugin (Composition by dust)

ok so i have this running with the panel plugin so there is no issues with the path. i have now pushed the audio recording to its own runloop so there will not be any graphical interruptions.

directions are.

  1. install the latest Panel plugin if you have not, its included.
  2. install the latest AudioRecorder to /Graphics/Plugins..etc
  3. open Recording example
  4. push save button
  5. choose desktop name file "myfile.caf"
  6. hit save to start recording

the level meter should turn red when recording and turn off when it reaches your predetermined length of recording.

PreviewAttachmentSize
AudioRecorder Plugin2.zip793.97 KB

monobrau's picture
Re: Audio Recorder Plugin (Composition by dust)

Cool, works! Thanks!

dust's picture
Re: Audio Recorder Plugin (Composition by dust)

just noticed the ports all had the name record on them. i guess it took a bit for qc to update my patch. ;P

PreviewAttachmentSize
AudioRecorder Plugin 2.1.zip793.98 KB

chiara's picture
Re: Audio Recorder Plugin (Composition by dust)

Hi Dust,

I've just try your Audio Record plugin, because I'm creating a comp. in q.c. where I can record and then listen the saved audio files (maybe using the kineme audio palyer). The problem is the caf exten. I can't paly it with kineme audio palyer or for ex. quick time, vlc, etc. I've opened the file as txt. Please see the image i've attached. Sure i'm missing something... or some step for saving the file. Thanks Chiara

PreviewAttachmentSize
Schermata 11-2455896 alle 12.25.36.png
Schermata 11-2455896 alle 12.25.36.png300.86 KB

chiara's picture
Re: Audio Recorder Plugin (Composition by dust)

Problem solved :-) i forgot to write .CAF!

dust's picture
Re: Audio Recorder Plugin (Composition by dust)

yeah sorry about that you can name the file anything you like for example myFile.mp3 even though it should be myFile.caf or .CAF. i thought it might be best to not put .caf on the end for you as then you could do things like myFile.caf.caf. which actually might still work. as you found out myFile without an extension doesn't work well. the examples required plugin "panel" i left sort of generic and not proprietarily unique to the audio recorder plugin although i idid make it for the audio recorder plugin i thought this was best as it could be used for any type of file. it is however possible to to check for the no extension scenario with a slight modification to the "panel plugin".

If I remember correctly I may have mentioned that it may be a good addition to set or limit required extensions with the "panel plugin". as it is now the panel plugin is using some older deprecated code so i should fix that, as things have changed in lion. it should however work still in lion for now. CAF is in my opinion best suited for this type of audio recoding. i think in the future adding compressed formats and things like that might be a good idea, but for now those things can be easily done in iTunes or something like. CAF is the Apple preferred extension for doing things with audio units on apple. CAF works well with Kineme Audio Tools so playing back the file shouldn't be an issue. Actually CAF does some really cool things like utilize meta data lets you store sampler instrument zones and define multi-channels and other cool things, that this plugin doesn't make use of. however i have been meaning to mess around with some of the new audio video framework things in lion so more than likely I will be updating this plugin soon.

let me know if there any things that could be of particular use, as it is this is pretty much a straight audio recorder. one thing that i would like to do is dynamically write a temp file and possible compress so that you do not have to specify the actual recording time limit ?

chiara's picture
Re: Audio Recorder Plugin (Composition by dust)

Hi Dust, My fault, you're right to not put or specify any extension, that's better!

Yesterday, I was trying just to listen at the caf file with the k. audio player and modify the audio with some effects. I was using the patch accumulator, blur, math, etc to generate some distortion's effects. May can I ask you, how can I build a directory (if possible) where qc can saves all the recorded caf files and then, I can play the files randomly using multiple audio player patches... 3 or 4. I would like to build a comp. where is possible to record audio files, then listen at all scanning the files randomly from a directory, and also transform the audio in phrases to screen. Difficult :-( Thanks, Chiara

PreviewAttachmentSize
Immagine 3.png
Immagine 3.png25.41 KB
Schermata 12-2455897 alle 12.11.56.png
Schermata 12-2455897 alle 12.11.56.png292.21 KB

dust's picture
Re: Audio Recorder Plugin (Composition by dust)

Hmm I'm not sure the director scanner could work. Sort of like how you would get a list of photos in a folder but change the from photo list to maybe movie might work. Once you have this list you could pull out random indexes to play back with. Maybe even better is to just name your files rec0.caf rec1.caf etc save them in the same folder and use a random counter string tools pull generate the names to play back for you.

chiara's picture
Re: Audio Recorder Plugin (Composition by dust)

Thanks, I'll try! I was thinking to use the speech synt. (now works on lion) to listen at the files, maybe it's better than the audio player... not sure, hmmm, must try :-)

scalf's picture
Re: Audio Recorder Plugin (Composition by dust)

Hey Dust,

Great job on the recorder plugin. I was having a few troubles though.

In the composition, I am using a drum pad (replace with keyboard) to trigger sounds. I am then using your recorder patch to record the sounds I make. Using the space bar to toggle recording.

I was wondering if there was a way to record the system output, or preferably the output from just Quartz Composer? I know there is your standard "internal microphone" and "line in" but I was curious if there was another way to get the system sound.

Also, when I hit record the controls on the comp freeze and all sound is dropped when I press the keys. No sound goes to my headphone and when I listen to the saved recording it is from the "internal microphone". I set the input limit to 10 and I assume that means seconds. I might have thought if it was set to 10 minutes instead that could be the problem.

Thanks

PreviewAttachmentSize
Drum Pad Record.qtz12.02 KB

cybero's picture
Re: Audio Recorder Plugin (Composition by dust)

What about using Soundflower ?

monobrau's picture
Re: Audio Recorder Plugin (Composition by dust)

Calling Dust on this one,

I'm trying to use soundflower as an audio source. Tried to record with device set from 0 to 11, but it always seems to use the internal mic. How does the device numeration work with this patch, or does it work at all?

Thanks!

dreamrec's picture
Re: Audio Recorder Plugin (Composition by dust)

monobrau wrote:
Calling Dust on this one,

I'm trying to use soundflower as an audio source. Tried to record with device set from 0 to 11, but it always seems to use the internal mic. How does the device numeration work with this patch, or does it work at all?

Thanks!

hello

i have the same issue .. how do i change the input from the internal mic to another input , like soundflower ( the sound generated from qtz itself)

thank you

yourbartender's picture
Re: Audio Recorder Plugin (Composition by dust)

Hmmm. any chance to add "Stop Recording" -option? I tried to send false to the Record -input, to the enable input and set the record time to zero, but once the recording starts it just keeps going whatever the duration is. I am trying to build an interactive piece for a museum where visitors can leave their comments / stories (either on guided situations or then bad-words-filtered-out later on). Either we end up with a lot of stories which are cut out or with a lot of empty space in them...

dust's picture
Re: Audio Recorder Plugin (Composition by dust)

sound flower will let your record quartz. set soundflower up and use it as an input and soundflower bed as monitor.

dust's picture
Re: Audio Recorder Plugin (Composition by dust)

bar tender i havent looked at this file in along time. if i remember correctly you have to add the length of your recording but you may be able to use a timer for that, i will have to install and look at.

yourbartender's picture
Re: Audio Recorder Plugin (Composition by dust)

Tried setting the timer to zero to stop recording, but it only remembers the original value. I also noticed the plugin still had all inputs named "Record" so I rebuilt it in Xcode. I guess it wouldn't be too difficult to add the stop input over there, but my experience of Xcode is minimal. The audio player has a stop input...

Another option would be to store the stop moment in a text file / structure (I am storing the counter value anyway - how manieth recording etc) and then just play the file (let's say recording #34, stopped at 25:43 seconds) until that time. But it is a hack I wouldn't like to do :) Thanks for AkuMaku suggesting it though :)