Issues with AudioConverter, AAC, and silence
Issues with AudioConverter, AAC, and silence
- Subject: Issues with AudioConverter, AAC, and silence
- From: Neil Clayton <email@hidden>
- Date: Tue, 24 Feb 2009 15:00:54 +1300
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hellooo!
I am having a weee issue with AudioConverter / QT.
1) Receiving audio from a circular buffer.
2) Using this as the source data for an AudioConverter
3) The converter is configured for AAC, 2 ch. The source is also
2ch. The input / output rates are 44.1k.
4) The packets are saved to a QT movie file via the AddMediaSample2 QT
API.
5) I am "checkpointing" the media every 5s (in case of system crash, I
want the media to be usable). All checkpoints have error checking,
all media times coming out of each checkpoint seem fine. No errors
reported.
What I'm observing is that if I feed silence into the AudioConverter,
packets are received, processed and stored, but after the SECOND
checkpoint the QuickTime movie is corrupted. The first checkpoint is
OK, I can open the movie in QT and hear it. After the second
checkpoint it's broken and not even openable by Dumpster.
If I do not feed silence, then it's fine.
If I feed about 1s of non-silence, and then feed silence, it's fine.
If I use PCM, it's fine - doesn't matter what I do (which is what I'd
expect).
I realise my entire system has a number of parts, and before I par it
down I wanted to see if someone had come across anything remotely like
this in the past. I realize it might be a QT (not CA) problem, but
I'm posting here first because I flipped a coin :-)
Regards,
Neil Clayton
Reference code, saving packets of AAC audio:
if(packetDescriptions) {
// if we've got packet descriptions, we need to add them one at a time
for(int i = 0; i < numberOfPackets; i++) {
AudioStreamPacketDescription *pd = &packetDescriptions[i];
err = [destination addMediaSample:media
dataIn:(UInt8*)outputBufferList->mBuffers[0].mData + pd-
>mStartOffset
size:pd->mDataByteSize
decodeDurationPerSample:pd->mVariableFramesInPacket ? pd-
>mVariableFramesInPacket : outASBD.mFramesPerPacket
displayOffset:0
sampleDescHandle:(SampleDescriptionHandle)soundDescriptionHandle
numSamples:1
sampleFlags:0];
haveWrittenSamples = YES;
if(err) {
[self log:@"Error adding packet %ld, error: %ld", i, err];
}
}
} else {
Neil Clayton
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