Recording to file
Recording to file
- Subject: Recording to file
- From: Paul Haddad <email@hidden>
- Date: Fri, 5 Jul 2002 14:05:51 -0500
Hi All,
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.
---
Paul Haddad (email@hidden) AIM:(ETS Paul)
AudioDeviceAddIOProc(deviceID, recordStream, self);
AudioDeviceStart(deviceID, recordStream);
AudioStreamGetProperty(streams[index], 1,
kAudioStreamPropertyPhysicalFormat, &dataSize, &description);
printf("%f %d %d %d %d %d %d %d\n",
description.mSampleRate,
description.mFormatID,
description.mFormatFlags,
description.mBytesPerPacket,
description.mFramesPerPacket,
description.mBytesPerFrame,
description.mChannelsPerFrame,
description.mBitsPerChannel);
// 44100.000000 1819304813 12 4 1 4 2 16
static OSStatus recordStream(AudioDeviceID inDevice, const
AudioTimeStamp *inNow, const AudioBufferList *inInputData, const
AudioTimeStamp *inInputTime, AudioBufferList *outOutputData, const
AudioTimeStamp *inOutputTime, void *inClientData)
{
fwrite(inInputData->mBuffers[0].mData,
inInputData->mBuffers[0].mDataByteSize, 1, recordFile);
}
_______________________________________________
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.