Re: AAC/MP3 to raw audio
Re: AAC/MP3 to raw audio
- Subject: Re: AAC/MP3 to raw audio
- From: Doug Wyatt <email@hidden>
- Date: Thu, 11 May 2006 10:50:44 -0700
On May 10, 2006, at 22:06 , Ivan C Myrvold wrote:
Den 10. mai. 2006 kl. 20:49 skrev Doug Wyatt:
On May 8, 2006, at 9:25 AM, Ivan C Myrvold wrote:
I have been looking at afconvert. I think this will be very close
to what I need. I want to convert from e.g. aac or mp3 format, to
raw audio, 8kHz sample rate, mono (single channel).
But I am overwhelmed by the list of options this tool can handle.
Can anyone give me the correct syntax with afplay for this?
Do you mean afconvert?
afconvert -f AIFF -d BEI16@8000 -c 1 infile outfile
I tried this on an AAC file, encoded with iTunes, and I got
error -1: output channel layout has wrong number of channels
Error: output channel layout has wrong number of channels (-1)
Does this mean that afconvert can not convert from AAC files?
There's something stupid going on with channel layouts and some file
formats. I'll investigate.
As a workaround you can convert to a stereo AIFF then run afconvert
again to strip the right channel:
$ afconvert ab.aac /tmp/foo.aif -f AIFF -d BEI16@8000
$ afconvert /tmp/foo.aif /tmp/foo-mono.aif -f AIFF -d BEI16 -c 1
If you'd rather the two channels were downmixed to mono rather than
having the right channel dropped, then you'll need a different tool.
Most sample editors can do this; it's also pretty trivial to write
such a tool using ExtendedAudioFile.
Doug
--
Doug Wyatt
Core Audio, Apple
_______________________________________________
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