Re: problems using afconvert to do alac to aac
Re: problems using afconvert to do alac to aac
- Subject: Re: problems using afconvert to do alac to aac
- From: "the deep" <email@hidden>
- Date: Mon, 2 Jul 2007 17:38:35 -0700
I'm new to coreaudio, but would this be the conditional causing the exception:
from CAAudioFile.cpp:
void CAAudioFile::SetNumberFrames(SInt64 nFrames)
{
XThrowIf(mFileDataFormat.mFramesPerPacket != 1,
kExtAudioFileError_InvalidDataFormat, "SetNumberFrames only supported
for PCM");
XThrowIfError(AudioFileSetProperty(mAudioFile,
kAudioFilePropertyAudioDataPacketCount, sizeof(SInt64), &nFrames),
"Couldn't set number of packets on audio file");
}
if so, how exactly do I deal with mFramesPerPacket. I'm afraid I might
need a link or two on how audio is dealt with
digitally/programatically, I'm a graphics programmer unfortunately.
thanks!
On 7/1/07, Andrew Barnert <email@hidden> wrote:
My guess is that the sample is putting together some collection of
conversion parameters that isn't valid for CAAudioFileConverter. The
exact problem may not be documented, but it probably won't be too
hard to guess or figure out once you know what params you're passing.
So, just get afconvert.cpp to dump all of the members of its params
right before calling mAFConverter->ConvertFile(params) and play with
changing the settings right there (or breakpoint it in the debugger).
It's also possible there's an even simpler, less-audio-related bug in
the sample code (which is, after all, sample code that probably three
people outside of Apple have tried to use...). Maybe the
ParseStreamDescription code doesn't handle 4ccs with spaces properly,
or something else equally silly.
On 1 Jul 2007, at 22:06, the deep wrote:
> hi, first time caller. I've googled through the archives but haven't
> found anything that'll help with this little problem I'm having.
>
> I'm trying to use afconvert to go from an alac encoded m4a to one
> encoded with aac (I'm hoping to use this in a set of scripts which
> will generate a compressed music library from uncompressed).
>
> I'm getting an Error: SetNumberFrames only supported for PCM (-66566)
>
>
> running 10.4.8, I get this:
>
> % afconvert -v -f adts -d "aac " tmm_alac.m4a tmm_aacTest.m4a
> Input file: tmm_alac.m4a, 14655488 frames
> Formats:
> Input file 2 ch, 44100 Hz, 'alac' (0x00000001) from 16-bit
> source, 4096 frames/packet
> Output file 2 ch, 44100 Hz, 'aac ' (0x00000002) 0 bits/channel,
> 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
> Stereo
> Input client 2 ch, 44100 Hz, 'lpcm' (0x0000000B) 32-bit big-
> endian float
> AudioConverter 0x1814e74 [0x3196e0]:
> CodecConverter 0x319b40
> Input: 2 ch, 44100 Hz, 'alac' (0x00000001) from 16-bit source,
> 4096 frames/packet
> Output: 2 ch, 44100 Hz, 'lpcm' (0x0000000E) 16-bit big-endian
> signed integer
> PCMConverter 0x319a10
> Input: 2 ch, 44100 Hz, 'lpcm' (0x0000000E) 16-bit big-endian
> signed integer
> Output: 2 ch, 44100 Hz, 'lpcm' (0x0000000B) 32-bit big-endian
> float
> Output client 2 ch, 44100 Hz, 'lpcm' (0x0000000B) 32-bit big-
> endian float
> AudioConverter 0x1814e7c [0x319d40]:
> CodecConverter 0x31a010
> Input: 2 ch, 44100 Hz, 'lpcm' (0x0000000B) 32-bit big-endian
> float
> Output: 2 ch, 44100 Hz, 'aac ' (0x00000002) 0 bits/channel, 0
> bytes/packet, 1024 frames/packet, 0 bytes/frame
> error -66566: SetNumberFrames only supported for PCM
>
> Error: SetNumberFrames only supported for PCM (-66566)
>
>
> similarly when using -f m4af instead of -f adts.
>
> I started off trying to write my own app using coreaudio, then noticed
> afconvert while reading the docs---am I just calling it incorrectly?
>
>
> thanks!
> deep
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> 40yahoo.com
>
> 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