Re: Recording to file
Re: Recording to file
- Subject: Re: Recording to file
- From: Paul Haddad <email@hidden>
- Date: Sat, 6 Jul 2002 08:30:31 -0500
Jeff & All,
Ok I've gotten my format issues worked out, thanks to you and John.
My follow up question is what's the proper way to queue up the data and
pass it to the other thread. John suggested one way, which of the top
of my head seems somewhat expensive. I've tried using a fifo (mkfifo),
NSPipe, mach semaphore with circular buffer and unix semaphore with
circular buffer (sem_open).
Using the unix semaphore seemed to yield the best performance (the CPU
wasn't pegged) and it was relatively simple, but I'd much rather use
some sort of fifo/queue structure so that I could easily read the data
in sizes other then 1024 samples (lame seems to like 1152/channel).
So what if any is the one true way?
On Friday, July 5, 2002, at 02:37 PM, Jeff Moore wrote:
Your first problem is that you are writing to a file from the IOProc.
This is not generally going to produce good performance. You need to
queue the data somewhere so that another, lower priority thread can
write it to disk.
Your next problem is that you aren't going to get the format provided
by kAudioStreamPropertyPhysicalFormat in your IOProc.
kAudioDevicePropertyStreamFormat will give you the format you will see
in your IOProc. The two will be different for linear PCM formats, as
only Float32's are vended out of the HAL.
On Friday, July 5, 2002, at 12:05 PM, Paul Haddad wrote:
I'm using a superset of the below code to test recording to a file
from line in.
I've then tried several variations of command line options to both
lame and sox to try to get a file that sounds normal with no luck.
The closest sounding is the following options to lame
lame -f --bitwidth 32 -m s -s 44.1 test.raw test.mp3
I think/hope I'm missing something simple and easy to fix. Can anyone
point out whatever I'm doing wrong? Or even some sample code that
records to file.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
---
Paul Haddad (email@hidden) AIM:(ETS Paul)
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.