Re: MP3 conversion problem using AudioConverter
Re: MP3 conversion problem using AudioConverter
- Subject: Re: MP3 conversion problem using AudioConverter
- From: Mike Simmons <email@hidden>
- Date: Mon, 12 Mar 2007 08:22:35 -0500
Thanks for the suggestion -- I wasn't familiar with that API, and it
looks simpler to user than Core Audio. In trying it, though, it looks
like the framework hasn't been extended to the Intel processor, and I
need that for the speed.
In revisiting my problem, I'm wondering if it perhaps has something
to do with the leading frames expected. I put in code to call to
AudioConverterGetProperty with kAudioConverterPrimeInfo as the
parameter. In the leadingFrames field is a value of 1152. I'm not
sure how to supply these leading frames on the first call.
Does anyone know if I'm heading down the right path here?
Thanks,
Mike
Landmark Digital Services, Inc.
On Mar 9, 2007, at 2:01 PM, David M. Cotter wrote:
I highly recommend the movieaudioextraction api instead of fill
complex buffer. in the end, you'll be glad you did.
On Mar 9, 2007, at 8:35 AM, Mike Simmons wrote:
I'm reading MP3 frames from a stream and calling
AudioConverterFillComplexBuffer to downsample the audio to 8 kHz
as well as convert it to linear PCM. The problem is that the first
time AudioConverterFillComplexBuffer is called, it repeatedly
invokes the input proc and eventually crashes with a
EXC_BAD_ACCESS error. I'm successfully doing virtually the same
conversion using linear PCM at 44.1 kHz for the input stream, so I
know I have the basic concept down; it's just something I'm not
understanding about mp3, I think.
Should the input proc be providing only the raw mp3 samples to
AudioConverterFillComplexBuffer? It doesn't seem to matter whether
I supply a full mp3 frame with header, or just raw data.
Here is info displayed by the program as it runs. First, some info
on the stream itself:
Version: MPEG-1 layer III
Mode: joint stereo
Stream bit rate: 128000
Frame size: 417
Sample rate: 44100
CRC protected: YES
Next, the ASBD for the mp3 input:
inetASBD.mFormatID = 778924083
inetASBD.mSampleRate = 44100.000000
inetASBD.mFormatFlags = 0
inetASBD.mBytesPerFrame = 0
inetASBD.mBytesPerPacket = 0
inetASBD.mFramesPerPacket = 1152
inetASBD.mChannelsPerFrame = 2
Next, the ASBD for linear PCM output:
lmASBD.mFormatID = 1819304813
lmASBD.mSampleRate = 8000.000000
lmASBD.mFormatFlags = 44
lmASBD.mBytesPerFrame = 2
lmASBD.mFramesPerPacket = 1
llmASBD.mBytesPerPacket = 2
lmASBD.mChannelsPerFrame= 1
And finally, the call stack showing where the program is dying:
#0 0x0101b4c0 in ACMP3DecoderEntry
#1 0x0101b397 in ACMP3DecoderEntry
#2 0x010e31cd in ACAMREncoderEntry
#3 0x90ccba34 in CallComponentDispatch
#4 0x93e43b87 in AudioCodecAppendInputData
#5 0x93d65f9d in CodecConverter::AppendNewInput
#6 0x93d65d5f in CodecConverter::CallInputProc
#7 0x93d65707 in CodecConverter::DecoderFillBuffer
#8 0x93d4ae32 in BufferedAudioConverter::GetInputBytes
#9 0x93d4ad0f in CBRConverter::RenderOutput
#10 0x93d4aa73 in BufferedAudioConverter::FillBuffer
#11 0x93d4ae32 in BufferedAudioConverter::GetInputBytes
#12 0x93d4ad0f in CBRConverter::RenderOutput
#13 0x93d4aa73 in BufferedAudioConverter::FillBuffer
#14 0x93d4b592 in BufferedInputAudioConverter::CallInputProc
#15 0x93d4b32a in BufferedInputAudioConverter::GetAllInputBytes
#16 0x93d4b25d in Resampler2Wrapper::RenderOutput
#17 0x93d4aa73 in BufferedAudioConverter::FillBuffer
#18 0x93d4ae32 in BufferedAudioConverter::GetInputBytes
#19 0x93d4ad0f in CBRConverter::RenderOutput
#20 0x93d4aa73 in BufferedAudioConverter::FillBuffer
#21 0x93d4ac01 in AudioConverterChain::RenderOutput
#22 0x93d4aa73 in BufferedAudioConverter::FillBuffer
#23 0x93d4a900 in AudioConverterFillComplexBuffer
#24 0x00009fc4 in
BlueArrow::AudioDeviceImplementation::InetStream::ConvertStream at
inetstream.cpp:438
Any help is greatly appreciated!
Regards,
Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40davecotter.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