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

Re: Modifying afrecord sample file


  • Subject: Re: Modifying afrecord sample file
  • From: Bruno Blondeau <email@hidden>
  • Date: Mon, 17 May 2004 00:46:01 +0200

Well, the afconvert.cpp doesn't seem very easy to understand for a CoreAudio beginner. It seems I have to dig into CAAudioFileConverter and so on... I have tried to find similarities with afrecord but this is far from easy for someone who doesn't have a clear understanding of the audio formats and who is just looking at something to plug in his applications (so as to play, record,...). The examples in this folder are great, as they can be reused nearly directly (so as to play a file, so as to convert a file...), but there lacks something which could be reused to record files in a compressed form, and which could be reused by people who don't need to have a complete understanding of CoreAudio. I'm not writting a real audio app. I would like to have a simple API to play/record files. QuickTime isn't easy, but still easier than CoreAudio it seems... and I would like to avoid using QT if possible, as it seems to be an unnecessary layer.

Is there any shorter sample code which would show how to handle these compressed formats? Something which would be more like the afrecord sample?

Bruno

On 14 mai 04, at 21:43, William Stewart wrote:

for any of these - have a look at the afconvert code in the same project... it shows you how to set up a desc for AAC (and handle setting things like desired bit rate, etc).

Bill

On 13/05/2004, at 2:50 PM, Bruno Blondeau wrote:

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.


-- mailto:email@hidden
tel: +1 408 974 4056

_______________________________________________________________________ ___
Culture Ship Names:
Ravished By The Sheer Implausibility Of That Last Statement
I said, I've Got A Big Stick [OU]
Inappropiate Response [OU]
Far Over The Borders Of Insanity And Still Accelerating [Eccentric]
_______________________________________________________________________ ___
_______________________________________________
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.


References: 
 >Modifying afrecord sample file (From: Bruno Blondeau <email@hidden>)
 >Re: Modifying afrecord sample file (From: William Stewart <email@hidden>)

  • Prev by Date: Re: small buffer size
  • Next by Date: Re: frameworks for an AU
  • Previous by thread: Re: Modifying afrecord sample file
  • Next by thread: Re: Modifying afrecord sample file
  • Index(es):
    • Date
    • Thread