• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: multi input mixer volume control on iOS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multi input mixer volume control on iOS


  • Subject: Re: multi input mixer volume control on iOS
  • From: Chris Adamson <email@hidden>
  • Date: Thu, 10 May 2012 10:40:58 -0400

Dean--

The demo I've been doing in my recent iOS 5 Core Audio talk has a volume slider that adjusts the input into a mixer. Go to my blog entry for Voices That Matter Boston Fall 2011 <http://www.subfurther.com/blog/2011/11/16/what-you-missed-at-voices-that-matter-ios-fall-2011/> and grab the VTMAUGraphDemo.zip project <http://dl.dropbox.com/u/12216224/conferences/vtm11/VTMAUGraphDemo.zip>. It's a little messy in dealing with the float ASBDs that the effects want to take, sorry. Still, in the master view controller, you'll see there's a multichannel mixer:

compDesc.componentType = kAudioUnitType_Mixer;
compDesc.componentSubType = kAudioUnitSubType_MultiChannelMixer;
compDesc.componentManufacturer = kAudioUnitManufacturer_Apple;
AUNode mixerNode;
CheckError(AUGraphAddNode(self.auGraph, &compDesc, &mixerNode),
                          "AUGraphAddNode[kAudioUnitSubType_MultiChannelMixer] failed");

and in the detail view controller, there's a method to set the volume parameter (not property!) on the input scope:

-(IBAction)handleVolumeSliderChange:(id)sender {
    NSLog (@"handleVolumeSliderChange");
    AudioUnitParameterValue volume = self.volumeSlider.value;
    CheckError(AudioUnitSetParameter(self.mixerInput.mixerUnit,
                                     kMultiChannelMixerParam_Volume,
                                     kAudioUnitScope_Input,
                                     self.mixerInput.inputBus,
                                     volume,
                                     0),
               "Couldn't set volume on mixer");
}

Glad you're liking the book. Hope this helps.

--Chris

P.S. You're in Cedar Springs? Dude, I'm just down US-131 from you in Grand Rapids!

On May 10, 2012, at 10:27 AM, Dean Reyburn wrote:

I'm working on an ios app which has an audio unit mixer with two inputs. Almost everything is working thanks to Chris Adamson's book "Learning Core Audio" which I can't recommend highly enough.

My problem is, I need to separately control the relative volume of the two inputs before they are mixed. I can easily control the total output volume after mixing.

I'm mixing pre-recorded audio and processed live feedback audio from the microphone.

On page 189 Chris describes a mixer with two inputs, which is almost exactly the same situation. He mentions it's possible to control the volume property of the two input busses. However that's not supported by the mixer since I'm on iOS I'm using this type of mixer:

 kAudioUnitSubType_MultiChannelMixer;

On MacOS X the "matrix" mixer can adjust two inputs independently:

 kAudioUnitSubType_MatrixMixer

But according to the headers and Apple's docs, that doesn't work on iOS.

I could add a gain mixer into the chain just before the two channel mixer, but that would slow things down and add complication. Isn't there an easier way to do this with core audio built in mixers?

Thanks in advance...

-Dean

|| ||| || ||| || ||| || ||| || ||| || ||| || ||| || ||| || ||| || |||
RPS, Inc.              contact: <http://www.reyburn.com/contact.html>
Dean Reyburn, RPT
2695 Indian Lakes Road            web page: <http://www.reyburn.com/>
Cedar Springs, Michigan, 49319 USA
Sales & support: 1-888-SOFT-440 (or 616-340-7277)   Fax: 616-696-8121


 _______________________________________________
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

  • Follow-Ups:
    • Re: multi input mixer volume control on iOS
      • From: Dean Reyburn <email@hidden>
References: 
 >multi input mixer volume control on iOS (From: Dean Reyburn <email@hidden>)

  • Prev by Date: multi input mixer volume control on iOS
  • Next by Date: Re: multi input mixer volume control on iOS
  • Previous by thread: multi input mixer volume control on iOS
  • Next by thread: Re: multi input mixer volume control on iOS
  • Index(es):
    • Date
    • Thread