Re: Crashing in AudioConverterConvertBuffer
Re: Crashing in AudioConverterConvertBuffer
- Subject: Re: Crashing in AudioConverterConvertBuffer
- From: Philippe Wicker <email@hidden>
- Date: Thu, 14 Aug 2003 07:20:35 +0200
On Wednesday, August 13, 2003, at 10:48 PM, Robert Grant wrote:
Hi Robert,
I suppose you are trying to use AudioConverterConvertBuffer with an
interleaved source stream and a non interleaved destination stream.
When I started using the AudioConverter, this is also what I wanted to
do, but I could never succeed to convert interleaved to non
interleaved. I always received an error 'insz' if I remember well. So I
gave up and did this with the "Complex" set of API
(AudioConverterFillComplexBuffer) and it works. It's more complicated
to use but seems to still be very efficient (from a CPU point of view).
The key point when using "Complex" variant is that the converter asks
you for a given amount of data packets in the ComplexInputDataProc
callback. Here you can return less or more than it requests. If you
return less, the callback will be recalled immediately, if you return
more, the callback will be recalled when the converter has consumed all
the data (it will then request you to return the remainder necessary to
fill the current render buffer). You could have a look at PlayAudioFile
sample code (file AudioFilePlayer.cpp).
>
Well a little knowledge is a dangerous thing....
>
>
Getting a consistent crash in AudioConverterConvertBuffer now that I
>
can create a converter :-)
>
>
I have to say that even after reviewing the ADC session on Audio
>
Formats I'm still confused about the memory layout of a
>
non-interleaved buffer.
>
>
Here's what I think it should be for 2048 frames of non-interleaved
>
stereo samples:
>
>
0 ... 2047 left channel samples
>
2048... 4095 right channel samples
>
>
That would then get converted into a interleaved buffer:
>
0 ... 4095
>
>
Any chance of some docs on AudioConverterConvertBuffer?
>
>
Here's the crash log:
>
>
Thread 0 Crashed:
>
#0 0x94d038f4 in Float32ToNativeInt16
>
#1 0x94cb2370 in CBRConverter::RenderOutput(CABufferList*, unsigned
>
long, unsigned long&)
>
#2 0x94cb220c in BufferedAudioConverter::FillBuffer(long
>
(*)(OpaqueAudioConverter*, unsigned long*, void**, void*), long
>
(*)(OpaqueAudioConverter*, unsigned long*, AudioBufferList*,
>
AudioStreamPacketDescription**, void*), void*, unsigned long&,
>
AudioBufferList&, AudioStreamPacketDescription*)
>
#3 0x94cb6718 in
>
CompositeAudioConverter::InputProc(OpaqueAudioConverter*, unsigned
>
long*, AudioBufferList*, AudioStreamPacketDescription**, void*)
>
#4 0x94cb20e8 in BufferedAudioConverter::CallInputProc(unsigned
>
long)
>
#5 0x94cb1dd0 in BufferedAudioConverter::GetInput(unsigned long,
>
unsigned long, unsigned long&, CABufferList const*&)
>
#6 0x94cb2310 in CBRConverter::RenderOutput(CABufferList*, unsigned
>
long, unsigned long&)
>
#7 0x94cb220c in BufferedAudioConverter::FillBuffer(long
>
(*)(OpaqueAudioConverter*, unsigned long*, void**, void*), long
>
(*)(OpaqueAudioConverter*, unsigned long*, AudioBufferList*,
>
AudioStreamPacketDescription**, void*), void*, unsigned long&,
>
AudioBufferList&, AudioStreamPacketDescription*)
>
#8 0x94cb6c74 in
>
CompositeAudioConverter::RenderOutput(CABufferList*, unsigned long,
>
unsigned long&)
>
#9 0x94cf4074 in BufferedAudioConverter::ConvertBuffer(unsigned
>
long, unsigned char*, unsigned long&, unsigned char*)
>
#10 0x94cbc804 in AudioConverterConvertBuffer
>
#11 0x0000ff4c in -[AIFFExporter
>
doExportFrom:to:sampleRate:bitDepth:]
>
>
Thanks,
>
>
Robert
>
_______________________________________________
>
coreaudio-api mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
>
Do not post admin requests to the list. They will be ignored.
>
>
Philippe Wicker
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.