Newbie Question about AudioConverter
Newbie Question about AudioConverter
- Subject: Newbie Question about AudioConverter
- From: Christoph Nägeli <email@hidden>
- Date: Fri, 23 Apr 2004 18:17:37 +0200
Hi all,
I got some questions about the API.
First, if I use CoreAudio, can I decompress every sound input that
QuickTime understands
or do I have to choose either QuickTime or CoreAudio?
Second, I'd like to convert a movie AudioTrack and I would prefer using
CoreAudio since the
API seems to be easier. Is there any example for it?
My Code looks as follows, but I got an error
(kAudioConverterErr_FormatNotSupported).
What's wrong with that?
And the last one,
how can I set the right Converter Configuration from the Standard
Sound Dialog?
Any help would be appreciated.
--
Christoph
// Convert from Unsigned Fixed to Float64
inDesc.mSampleRate =
(Float64)((*(SoundDescriptionHandle)gdp.desc)->sampleRate >> 16);
inDesc.mSampleRate +=
(Float64)Fix2X((*(SoundDescriptionHandle)gdp.desc)->sampleRate &
0xFFFF);
inDesc.mFormatID = (*(SoundDescriptionHandle)gdp.desc)->dataFormat;
inDesc.mFormatFlags = 0;
inDesc.mBytesPerPacket =
(*(SoundDescriptionV1Handle)gdp.desc)->bytesPerPacket;
inDesc.mFramesPerPacket = 0;
inDesc.mBytesPerFrame =
(*(SoundDescriptionV1Handle)gdp.desc)->bytesPerFrame;
inDesc.mChannelsPerFrame =
(*(SoundDescriptionHandle)gdp.desc)->numChannels;
inDesc.mBitsPerChannel = 0;
inDesc.mReserved = 0;
SCGetInfo(soundCompressor,scSoundSampleRateType,&outSampleRate);
outDesc.mSampleRate = (Float64)(outSampleRate >> 16);
outDesc.mSampleRate += (Float64)Fix2X(outSampleRate & 0xFFFF);
SCGetInfo(soundCompressor, scSoundCompressionType, &outDesc.mFormatID);
outDesc.mFormatFlags = 0;
outDesc.mBytesPerPacket = 0;
outDesc.mFramesPerPacket = 0;
outDesc.mBytesPerFrame = 0;
SCGetInfo(soundCompressor,scSoundChannelCountType,&numChannels);
outDesc.mChannelsPerFrame = numChannels;
outDesc.mBitsPerChannel = 0;
outDesc.mReserved = 0;
// Create the Converter Instance
status = AudioConverterNew(&inDesc,&outDesc,&converter);
if(status != noErr)
goto bail;
_______________________________________________
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.