Hi folks,
I'm trying to set up a converter to just change the sample rate of a stream on iOS 3.2, but it seems that this is not supported.
What I'm doing:
---[snip]--- AudioStreamBasicDescription outDescription = { 0 };
outDescription.mFormatID = kAudioFormatLinearPCM; outDescription.mFormatFlags = kAudioFormatFlagIsSignedInteger; outDescription.mFramesPerPacket = 1; outDescription.mBitsPerChannel = 16; outDescription.mSampleRate = 48000; outDescription.mChannelsPerFrame = 2; outDescription.mBytesPerPacket = sizeof(SInt16) * outDescription.mChannelsPerFrame; outDescription.mBytesPerFrame = sizeof(SInt16) * outDescription.mChannelsPerFrame; AudioStreamBasicDescription inDescription = outDescription;
outDescription.mSampleRate = 32000;
AudioConverterRef converter_; OSStatus result = AudioConverterNew(&inDescription, &outDescription, &converter); // result == 'fmt?' ---[/snip]---
I always get back kAudioConverterErr_FormatNotSupported/'fmt?' and don't understand why. If the sample rate is the same in inDescriptor and outDescriptor it works, even if the number of channels is different. But as soon as the sample rates differ I get the error. Tried setting the input sample rate higher or lower than the output sample rate, same result.
Is there a work-around or something that I'm not aware of ? Thanks a lot, Marc
--- Marc Haisenko Software Developer
equinux Aktiengesellschaft · Kirschstr. 35 · 80999 München - Germany
equinux USA Inc., 100 Produce Ave #L, South San Francisco, CA 94080 - USA
Vorstand: Till Schadde - Aufsichtsrat (Vors.): Stefan Neuenhahn Sitz: München - Registergericht: Amtsgericht München HRB 129700
Stay tuned what's going on at equinux
|