Re: Sound Recording using Cocoa
Re: Sound Recording using Cocoa
- Subject: Re: Sound Recording using Cocoa
- From: Todd Heberlein <email@hidden>
- Date: Tue, 4 Jun 2002 21:30:20 -0700
On Tuesday, June 4, 2002, at 05:58 PM, Scott Anguish wrote:
Yeah, I'm in the same boat.. I don't even mind dropping to Carbon..
I just need basic recording from a microphone..
Its not that bad for doing simple stuff. I just consider it C APIs and
ignore the fact that it is considered Carbon :-). As usual, Apple could
spend a little more time on documentation and examples.
I have a very simple application that record from a USB microphone,
plays back to the stereo speakers, and saves to an AIFF file (via the
free libsndfile library). The key was to register and start the input
procedure as soon as the program starts. It runs in its own thread, so
the inter-thread communication becomes an issue (i.e., the main event
thread for your user interface stuff and the thread for the recording
(or playing back) the audio). I just cheated and used some simple
global variables.
Some nice Object-C object wrappers would be a nice open source project
for someone.
Todd
PS. If you want a copy of the project, send me email (email@hidden).
It isn't real elegant, but it might give you a quick start.
PSS. The best example code I found for querying your audio components
(e.g., microphones and speaker system) was a command line tool installed
with the developer tools in the directory.
/Developer/Examples/CoreAudio/HAL/DisplayHALDeviceInfo
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.