Re: Sample rate conversion on iOS 3.2
Re: Sample rate conversion on iOS 3.2
- Subject: Re: Sample rate conversion on iOS 3.2
- From: William Stewart <email@hidden>
- Date: Wed, 13 Oct 2010 18:04:00 -0700
There's an issue in our code we need to sort out, but if you specify the "is packed" flag here this should work.
On Oct 13, 2010, at 9:39 AM, Marc Haisenko wrote:
> 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
> http://www.equinux.com/de
>
> equinux USA Inc., 100 Produce Ave #L, South San Francisco, CA 94080 - USA
> http://www.equinux.com
>
> Vorstand: Till Schadde - Aufsichtsrat (Vors.): Stefan Neuenhahn
> Sitz: München - Registergericht: Amtsgericht München HRB 129700
>
>
> Stay tuned what's going on at equinux
> equinux Blog | equinux @ Twitter | equinux @ Facebook
>
> _______________________________________________
> 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
_______________________________________________
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