Re: iPhone - AudioUnitRender() on 3DMixer
Re: iPhone - AudioUnitRender() on 3DMixer
- Subject: Re: iPhone - AudioUnitRender() on 3DMixer
- From: ROBB A MANIA <email@hidden>
- Date: Sat, 12 Sep 2009 10:45:11 -0700 (PDT)
Bill,
One more quick question on this: What do you mean by "it doesn't output 16bit int at this point"? What is the reason I can't change the 3DMixer output format? Is it always only able to output 8.24 fixed point? Or did my input settings cause this restriction?
Thanks. I want to make sure I get all my facts straight for my blog post.
Regards,
Robb --- On Fri, 9/11/09, William Stewart <email@hidden> wrote:
From: William Stewart <email@hidden> Subject: Re: iPhone - AudioUnitRender() on 3DMixer To: "ROBB A MANIA" <email@hidden> Date: Friday, September 11, 2009, 8:07 PM
On Sep 11, 2009, at 4:19 PM, ROBB A MANIA wrote:
> Bill, > I think you are right about the formats not matching. I explicitly set the input of the rioUnit to the following: > > memset(&audioFormat, 0, sizeof (audioFormat)); > audioFormat.mSampleRate = 44100.00; > audioFormat.mFormatID
= kAudioFormatLinearPCM; > audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; > audioFormat.mFramesPerPacket = 1; > audioFormat.mChannelsPerFrame = 2; > audioFormat.mBitsPerChannel = 16; > audioFormat.mBytesPerPacket = 4; > audioFormat.mBytesPerFrame = 4; > > However, I get a -10868 "format not support" error when I try to apply this format to the output of the 3DMixer. I decided to try a work-around. I am already setting the input format of the 3DMixer to mono inputs, so I decided to see what the default output format is when I set the
input. I get the following: > > 2009-09-11 18:55:09.094 MyApp[2215:20b] sample rate: 44100.000000 > 2009-09-11 18:55:09.100 MyApp[2215:20b] mFormatID: 1819304813 > 2009-09-11 18:55:09.101 MyApp[2215:20b] mFormatFlags: 3116 > 2009-09-11 18:55:09.102 MyApp[2215:20b] mFramesPerPacket: 1 > 2009-09-11 18:55:09.103 MyApp[2215:20b] mChannelsPerFrame: 2 > 2009-09-11 18:55:09.105 MyApp[2215:20b] mBitsPerChannel: 32 > 2009-09-11 18:55:09.107 MyApp[2215:20b] mBytesPerPacket: 4 > 2009-09-11 18:55:09.108 MyApp[2215:20b] mBytesPerFrame: 4 > > > I decided to try the opposite of what you suggest and set the input format of the rioUnit to this 'default' output format of the 3DMixer.
That's actually what I meant, just didn't express it properly
> It worked, which is great! The only problem is I don't completely understand a few things: > (1) Why wouldn't
the 3DMixer accept the format I originally specificed?
it doesn't output 16bit int at this point.
> (2) Everything makes sense to me in this format except the bits per channel and the format flags. 3116 indicates the 3rd and 4th bits are set which is expected. But the 11th and 12th bits are also set which doesn't seem defined according to the documentation. > (3) Why are the bits per channel 32? I definitely don't want to be doing twice the processing that I intend to.
this signifies 8.24 fixed point int in 32 bits
Bill
> > Here's additional info if you need it to answer the above questions: The 3DMixer has the following input format on all 8 inputs: > > memset(&threeDaudioFormat, 0, sizeof (threeDaudioFormat)); > threeDaudioFormat.mSampleRate = 44100.00; >
threeDaudioFormat.mFormatID = kAudioFormatLinearPCM; > threeDaudioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; > threeDaudioFormat.mFramesPerPacket = 1; > threeDaudioFormat.mChannelsPerFrame = 1; > threeDaudioFormat.mBitsPerChannel = 16; > threeDaudioFormat.mBytesPerPacket = 2; > threeDaudioFormat.mBytesPerFrame = 2; > > > I appreciate the help!
sure
> > Regards, > Robb
|
_______________________________________________
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