• 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
Modifying afrecord sample file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modifying afrecord sample file


  • Subject: Modifying afrecord sample file
  • From: Bruno Blondeau <email@hidden>
  • Date: Thu, 13 May 2004 23:50:51 +0200

I'm trying to modify the afrecord.cpp sample file so as to use AAC encoding instead of the PCM/AIFF one.

Could anyone explain me what to change?


const int kNumberBuffers = 3;
const unsigned kBufferSize = 0x8000;
CAAudioFile file;
CAAudioFileRecorder recorder(kNumberBuffers, kBufferSize);
CAStreamBasicDescription dataFormat;
dataFormat.mSampleRate = 44100.; // later get this from the hardware
dataFormat.mFormatID = kAudioFormatLinearPCM;
dataFormat.mFormatFlags = kAudioFormatFlagIsBigEndian | kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
dataFormat.mFramesPerPacket = 1;
dataFormat.mChannelsPerFrame = 2;
dataFormat.mBitsPerChannel = 16;
dataFormat.mBytesPerPacket = dataFormat.mBytesPerFrame = 4;
file.PrepareNew(dataFormat, 0.);
file.Create(recordFileName, kAudioFileAIFFType);
recorder.SetFile(file.GetAudioFileID());
Record(recorder);



Also, I've heard MP3 encoding isn't available. Is this still true?

What about QuickTime encoders? (Qualcomm, QDesign...)
Would it be possible to modify afrecord to use them and generate a quicktime readable file? (there doesn't seem to be a kAudioFile****** for these formats)


--
Bruno
_______________________________________________
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: Modifying afrecord sample file
      • From: Doug Wyatt <email@hidden>
    • Re: Modifying afrecord sample file
      • From: William Stewart <email@hidden>
  • Prev by Date: debugging aus in xcode
  • Next by Date: Newbie question
  • Previous by thread: Re: debugging aus in xcode
  • Next by thread: Re: Modifying afrecord sample file
  • Index(es):
    • Date
    • Thread