Re: Recording system audio
Re: Recording system audio
- Subject: Re: Recording system audio
- From: "Martin Redington" <email@hidden>
- Date: Wed, 19 Mar 2008 08:42:19 +0000
I think I'm there! Thanks very very much to everyone who's weighed in.
My recipe is as follows:
1) Install the sound flower kext (I used Joachim Bengtsson's 1.3.1 version).
2) Start the HALLab example and set the default output and system
devices to be the Sound Flower device.
Both the 2Ch and 16Ch seemed to work ok.
3) Start CAPlayThrough, and set the input to be SoundFlower, and the
output to be your normal output (e.g. the speakers).
4) Start up WhackedTV, and add a new audio channel, configure the
device to be the Sound Flower device. Leave the configuration panel
open.
5) Make your system beep (HALLab has a handy play alert sound button).
You should be able to see the levels jump on the WhackedTV Audio
settings, and also hear the beep through your speakers.
My recording kit is WhackedTV like, so this is perfect for me.
A few quick notes.
This is all on Tiger so far, although I need to run on Leopard+ as
well, although I don't think that will be a problem.
I was swapping between the 2 channel and 16 channel Sound Flower
devices a bit while I was getting this to work. Occasionally I seemed
to lose the output to the speakers. This only seemed to happen when I
was using the 2 channel device. Switching devices usually fixed this,
restarting CAPlayThrough always did. I have Jack half installed, and
various other funky kexts that I've been playing with, so my system is
not exactly pristine, so this may well be connected to that.
The autoresizingmasks on the stock (up-to-date) Tiger HALLab example
System Window Info tab are not quite right (but pretty trivially
fixed).
I couldn't make head or tail of AudioReflectorDriver. It didn't show
up in the Sound System Preference. At one point I seemed to be able to
set it as an output device in HALLab, but couldnt when I tried again
just now. When I could it as the output device in HALLab, it would get
reset as soon as I opened the Sound system preference.
I could set it as a device for an audio channel in WhackedTV, but I
never seemed to get any sound off it.
cheers and thanks again,
m.
On Tue, Mar 18, 2008 at 11:43 PM, Thorrin <email@hidden> wrote:
> Check out RecordAudioToFile and CAPlaythrough on the
> apple developer site.
>
> http://developer.apple.com/samplecode/MusicAudio/index-date.html#doclist
>
> For a proof of concept, you could run these 2 programs
> at the same time and 'chain' them together.
>
> Do this:
> -Set your default system OUTPUT to soundflower
> -Set the INPUT of CAPlaythrough to the same
> soundflower device
> -Set the OUTPUT of CAPlaythrough to speakers or
> headphones (whatever you choose)
> -Set the input source of RecordAudioToFile to be
> Soundflower.
> -Make some sound from itunes or whatever.
>
> This will record system audio to a file and play the
> sound out through the speakers. I'm actually in front
> of a PC right now (gasp) and I'm reciting this from
> memory... It will work though ;)
>
> This is a really big hack, but should do what you are
> trying to do. The source to the two programs above is
> provided so you can modify them as needed. These
> programs have a lot of good stuff in there, including
> the code that will show you how to set your system
> devices programatically (if not, it will at least get
> you very close to it).
>
> T
>
> --- Martin Redington
>
>
> <email@hidden> wrote:
>
> > Thanks very very much for all the very quick
> > replies.
> >
> > I've got SoundFlower and Jack, and have played
> > around with the Apple
> > Samples. Everything builds fine, and I can install
> > the kexts no
> > problem.
> >
> > I still think I'm missing something though - I can
> > set SoundFlower to
> > be the default input and output device globally, and
> > record the system
> > sound that way, but its not clear to me how to do
> > the equivalent
> > programmatically, and that setup loses me the normal
> > input, which I'd
> > like to record as well, and the system output to the
> > speakers as well.
> >
> > I guess what I want is
> >
> > system audio - presented as a device, so that I can
> > record an audio
> > track, but also played through to the speakers
> >
> > normal input - presented as a device, so that I can
> > record from this too.
> >
> > I guess one kext which handles the system audio and
> > passes it through
> > to the output it's normally configured for would do
> > the trick, but I'm
> > not sure how to get to that from the samples, or
> > without setting stuff
> > manually and globally from the System Preferences
> >
> >
> >
> > On Thu, Mar 13, 2008 at 9:02 PM, tahome izwah
> > <email@hidden> wrote:
> > > I believe they did, that's why I posted the link
> > to the latest
> > > version. Here it is again for your convenience:
> > >
> > >
> > > http://thirdcog.eu/apps/soundflower
> > >
> > > --th
> > >
> > > 2008/3/13, Jeff Moore <email@hidden>:
> > >
> > >
> > > > Just FYI, the AudioReflectorDriver and
> > SoundFlower do the basically
> > > > the same thing. They take the audio from their
> > output side and present
> > > > it back to the system through it's input side.
> > > >
> > > > Did Cycling'74 ever fix the timing issues in
> > SoundFlower? I recall a
> > > > while back that this driver had a wandering
> > clock due to the way it
> > > > did it's timing (which I think was based on
> > some older driver sample
> > > > code we put out). I last looked at it a few
> > years ago, so take it with
> > > > grain of salt.
> > > >
> > > >
> > > > On Mar 13, 2008, at 12:18 PM, Philippe GRUCHET
> > wrote:
> > > >
> > > > >
> > > > > You could also take a look at the
> > Soundflower source code:
> > > > >
> > > > > http://cycling74.com/downloads/soundflower
> > > > >
> > > > > Bye,
> > > > > PG
> > > > >
> > > > >
> > > > > On Mar 13, 2008, at 10:16 AM, Martin
> > Redington wrote:
> > > > >>> I'd like to record the system audio, on
> > 10.4 and 10.5
> > > > >>>
> > > > >>> Looking at other apps that do this, they
> > commonly seem to install
> > > > >>> a kernel extension which create a pseudo
> > audio device.
> > > > >>>
> > > > >>> Is this approach documented anywhere in
> > the sample code or docs?
> > > > >>> It seems to be common enough to qualify as
> > an idiom, but I can't
> > > > >>> seem to uncover any direct references to
> > it.
> > > > >>>
> > > > >>> Any pointers will be gratefully received
> > ...
> > > > >
> > > > >
> > > > > Jeff Moore replied:
> > > > >> There really aren't any docs about doing
> > what you want to do. The
> > > > >> system doesn't really make it particularly
> > easy. Even using a fake
> > > > >> device has it's drawbacks (see some of my
> > recent posts). At any
> > > > >> rate, the closest we have for sample code
> > in this area are the two
> > > > >> sample drivers in
> > /Developer/Examples/CoreAudio/HAL. The sample
> > > > >> kernel audio driver is the
> > AudioReflectorDriver project. The sample
> > > > >> user-land audio driver is the
> > SampleHardwarePlugIn project.
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > Jeff Moore
> > > > Core Audio
> > > > Apple
> > > >
> > > _______________________________________________
> > > Do not post admin requests to the list. They will
> > be ignored.
> > > Coreaudio-api mailing list
> > (email@hidden)
> > > Help/Unsubscribe/Update your Subscription:
> > >
> >
> > >
> > > This email sent to
> > email@hidden
> > >
> >
> >
> >
> > --
> > http://www.mildmanneredindustries.com/
> > _______________________________________________
> > Do not post admin requests to the list. They will be
> > ignored.
> > Coreaudio-api mailing list
> > (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
> >
> > This email sent to email@hidden
> >
>
>
> "Everyone is allergic to giant rocks hitting them in the head!"
> -Thorrin's elf chick after casting a 'meteor swarm' spell ;)
>
>
>
> ____________________________________________________________________________________
> Never miss a thing. Make Yahoo your home page.
> http://www.yahoo.com/r/hs
>
--
http://www.mildmanneredindustries.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden