• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Recording to file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Re: Recording to file
      • From: john <email@hidden>
    • Re: Recording to file
      • From: Jeff Moore <email@hidden>
  • Prev by Date: Memory Leaks and SPBRecord in OSX
  • Next by Date: Reading audio being sent to output device
  • Previous by thread: Building MIDI Driver(plugins) with CW
  • Next by thread: Re: Recording to file
  • Index(es):
    • Date
    • Thread