Re: skips in file using ExtAudioFileWrite in aac
Re: skips in file using ExtAudioFileWrite in aac
- Subject: Re: skips in file using ExtAudioFileWrite in aac
- From: Jonathan <email@hidden>
- Date: Fri, 16 Jul 2010 16:46:23 -0700
Are you normalizing on the fly?
Try using ExtAudioFileWriteAsync() instead. I had problems even with
ExtAudioFileWriteAsync (even though it says it buffers it internally)
so I ended up writing outside of the main thread.
On Fri, Jul 16, 2010 at 8:57 AM, Guy Shaviv <email@hidden> wrote:
> Hi,
> I'm creating an audio file using several file options. When creating an aac
> file I get random "knocks" and skips in the audio while when creating a caf
> from the same audio data the audio file is generated ok.
> To create aac I use:
> CAStreamBasicDescription dstFormat;
> dstFormat.mSampleRate = kSampleRate;
> dstFormat.mFormatID = kAudioFormatMPEG4AAC;
> dstFormat.mChannelsPerFrame = 2;
> UInt32 size = sizeof(dstFormat);
> AudioFormatGetProperty(kAudioFormatProperty_FormatInfo, 0, NULL, &size,
> &dstFormat);
> To create caf I use:
> CAStreamBasicDescription dstFormat;
> dstFormat.mSampleRate = kSampleRate;
> dstFormat.mFormatID = kAudioFormatLinearPCM;
> dstFormat.mChannelsPerFrame = 2;
> dstFormat.mBitsPerChannel = 16;
> dstFormat.mBytesPerPacket = dstFormat.mBytesPerFrame = 2 *
> dstFormat.mChannelsPerFrame;
> dstFormat.mFramesPerPacket = 1;
> dstFormat.mFormatFlags = kLinearPCMFormatFlagIsPacked |
> kLinearPCMFormatFlagIsSignedInteger; // little-endian
> I open the file using:
> OSStatus result = ExtAudioFileCreateWithURL((CFURLRef) [NSURL
> fileURLWithPath:file],
> type,
> &dstFormat,
> 0,
> kAudioFileFlags_EraseFile,
> &audioFileRef);
> And write to it using ExtAudioFileWrite(). My audio is normalized so it
> peaks at 0.0dB.
> Are there any limitations on the hardware AAC encoder that will cause it to
> create knocks or stop rendering? I'm suspecting the AAC encoding cause when
> not encoding (caf) the audio file turns out fine.
> Thanks.
> Guy
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden