Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: SCAudioFillBuffer





Begin forwarded message:

From: Joe Honoroff <email@hidden>
Date: September 8, 2006 12:39:36 PM PDT
To: 'Brad Ford' <email@hidden>
Subject: RE: SCAudioFillBuffer

Yes, I have been following the scaudiocompress sample.  However, when
our app publishes it sends me one video frame and that frame worth of
audio at a time, and specifies the buffer size. So for PCM output I
calculate ioOutputDataPacketSize as numPackets =
bufferSize/asbd.mBytesPerPacket which works.  For Apple Lossless output
I get MaximumOutputPacketSize, but it's larger then the sound buffer I'm
given.  In this case what should numPackets be? 

MaximumOutputPacketSize tells you the maximum size (in bytes) that a single packet might be.  In the case of Apple Lossless, if you look at the asbd, it should tell you how many pcm frames are in one packet by inspecting the mFramesPerPacket field.

I've tried numPackets =
1 but then SCAudioFillBuffer returns a PacketDescription with all the
members = 0.

I just tried "scaudiocompress -i /path/to/an_audio_file.aiff -o /path/to/a_quicktime_movie.mov -pullpackets 1

Then in the dialog, I specified Apple Lossless, and it worked perfectly.  So you can definitely pull for just 1 packet of lossless at a time, if you so desire.

-Brad Ford
QuickTime Engineering



Thanks
Joe 

-----Original Message-----
From: Brad Ford [mailto:email@hidden] 
Sent: Thursday, September 07, 2006 12:31 PM
To: Joe Honoroff
Subject: Re: SCAudioFillBuffer



On Sep 7, 2006, at 12:22 PM, Joe Honoroff wrote:

Where are the error return codes defined for SCAudioFillBuffer and
QTSetComponentProperty?

I get uncompressed PCM 44100Khz, 16bit, stereo from our app and I'm
using the new SCAudioFillbuffer.  I got it to work using the same  
output format, but now I'm trying to ouput Apple Lossless and  
SCAudioFillBuffer returns 0x77686174.

0x77686174 as a 4-char code is 'what'.  A lot of CoreAudio errors are  
4 character codes.  In this case, look at AudioConverter.h:

kAudioConverterErr_UnspecifiedError = 'what',

So it's an unspecified error. Not very helpful, I know.  It's not  
clear from your description what might be going wrong.  Have you  
looked at the scaudiocompress sample code?  It should succeed in  
writing Apple Lossless.

-Brad Ford
QuickTime Engineering


And yes I am providing a a AudioStreamPacketDescription!

Thanks
Joe
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-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.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden

References: 
 >RE: SCAudioFillBuffer (From: "Joe Honoroff" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.