Hi Matt,

thanks for quick reply. It's very helpful. Internet intermittent here,
hence late response.

It does seem that a mixer input can only receive samples from other units
or a callback with a precedence to an already connected unit. When I
disconnected the FilePlayerAU and connected another mixer without attaching
any units to its inputs and set the callbacks on them it started working
correctly.

regards,

- Marcin Rakowski

On Thu, Jul 21, 2016 at 7:00 PM, <[email protected]>
wrote:

> Send Coreaudio-api mailing list submissions to
>         [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.apple.com/mailman/listinfo/coreaudio-api
> or, via email, send a message with subject or body 'help' to
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Coreaudio-api digest..."
>
>
> Today's Topics:
>
>    1. Re: exceptions to using RenderCallback (Matt Grippaldi)
>    2. AudioUnitScheduleParameters with kStereoMixerParam_Volume
>       (Benjamin Federer)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 20 Jul 2016 17:12:52 -0400
> From: Matt Grippaldi <[email protected]>
> To: [email protected]
> Subject: Re: exceptions to using RenderCallback
> Message-ID:
>         <[email protected]>
> Content-Type: text/plain; charset="utf-8"
>
> If I understand the issue correctly to the best of my knowledge you should
> create another mixer input buss and add the render callback to the graph.
> You can not have a render callback on the same input that you are using for
> the AudioFilePlayer AU.
> Here is a snippet from some test code I have that renders multiple tracks
> of audio using graph render callbacks.
>
>     UInt32 inputBuss = 0;
>     for (int t=0; t < trackCount; ++t)
>     {
>         AURenderCallbackStruct input;
>         input.inputProc = AudioTrackRenderProc;
>         input.inputProcRefCon = &tracks[t];
>
>         CheckError(AudioUnitSetProperty(mixerUnit,
> kAudioUnitProperty_StreamFormat,
>                                         kAudioUnitScope_Input, inputBuss,
> streamFormat, sizeof(AudioStreamBasicDescription)),
>                    "Failed to set mixer buss input stream format.\n");
>         AUGraphSetNodeInputCallback(graph, mixerNode, inputBuss, &input);
>         ++inputBuss;
>     }
>
> And whatever you do, don’t forget to match the steam formats or you may
> get an earful of noise that you won’t soon forget.
>
> Hope this helps.
> - Matt
>
>
>
>
> > On Jul 20, 2016, at 12:20 PM, Matt Grippaldi <[email protected]>
> wrote:
> >
> > If I understand the issue correctly to the best of my knowledge you
> should create another mixer input buss and add the render callback to the
> graph.  You can not have a render callback on the same input that you are
> using for the AudioFilePlayer AU.
> > Here is a snippet from some test code I have that renders multiple
> tracks of audio using graph render callbacks.
> >
> >     UInt32 inputBuss = 0;
> >     for (int t=0; t < trackCount; ++t)
> >     {
> >         AURenderCallbackStruct input;
> >         input.inputProc = AudioTrackRenderProc;
> >         input.inputProcRefCon = &tracks[t];
> >
> >         CheckError(AudioUnitSetProperty(mixerUnit,
> kAudioUnitProperty_StreamFormat,
> >                                         kAudioUnitScope_Input,
> inputBuss, streamFormat, sizeof(AudioStreamBasicDescription)),
> >                    "Failed to set mixer buss input stream format.\n");
> >         AUGraphSetNodeInputCallback(graph, mixerNode, inputBuss, &input);
> >         ++inputBuss;
> >     }
> >
> > And whatever you do, don’t forget to match the steam formats or you may
> get an earful of noise that you won’t soon forget.
> >
> > Hope this helps.
> >
> > - Matt Grippaldi
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >> On Jul 20, 2016, at 6:31 AM, Marcin Rakowski <[email protected]
> <mailto:[email protected]>> wrote:
> >>
> >> Hi, I have a graph in which two separate AudioFilePlayer AUs are
> feediing into a Mixer unit that then outputs to Output unit. It works fine.
> >>
> >> Then I set up a render callback on the Mixer unit, but it never gets
> called.
> >>
> >>     AURenderCallbackStruct input;
> >>
> >>     input.inputProc = SineWaveRenderProc;
> >>
> >>     input.inputProcRefCon = &mixerCallback;
> >>
> >>     CheckError(AudioUnitSetProperty(mixerUnit,
> >>
> >>
>  kAudioUnitProperty_SetRenderCallback,
> >>
> >>                                     kAudioUnitScope_Output,
> >>
> >>                                     0,
> >>
> >>                                     &input,
> >>
> >>                                     sizeof(input)),
> >>
> >>                "AudioUnitSetProperty failed");
> >>
> >>
> >> Is this expected behaviour? The mixer is receiving samples on both
> inputs. Is there a way to switch where the unit is pulling data from, ie.
> inputs or RenderCallback?
> >>
> >> --
> >>
> >> Marcin
> >> http://google.com/+MarcinRakowskiConnect <
> http://google.com/+MarcinRakowskiConnect>
> >> _____________________________________
> >> "There are many paths, but only one journey."
> >>
> >> _______________________________________________
> >> Do not post admin requests to the list. They will be ignored.
> >> Coreaudio-api mailing list      ([email protected] <mailto:
> [email protected]>)
> >> Help/Unsubscribe/Update your Subscription:
> >>
> https://lists.apple.com/mailman/options/coreaudio-api/mattg%40kinematicsystems.com
> <
> https://lists.apple.com/mailman/options/coreaudio-api/mattg%40kinematicsystems.com
> >
> >>
> >> This email sent to [email protected]
> >
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://lists.apple.com/mailman/private/coreaudio-api/attachments/20160720/7170c59a/attachment.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Thu, 21 Jul 2016 19:18:18 +0200
> From: Benjamin Federer <[email protected]>
> To: [email protected]
> Subject: AudioUnitScheduleParameters with kStereoMixerParam_Volume
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=utf-8
>
> Hello everyone
>
> I am trying to ramp the input volume for one of the input busses of a
> stereo mixer unit (part of an AUGraph). Although I don’t get any errors
> when running my code, nothing happens at all, i.e. no audible volume
> changes occur. I am unsure what I am missing. Or could it be that the
> parameter just cannot be ramped at all – although it reports otherwise?
>
> This is what I got so far:
>
>
> AudioUnitParameter parameter = {
>                         .mAudioUnit = mixerUnit,
>                         .mParameterID = kStereoMixerParam_Volume,
>                         .mScope = kAudioUnitScope_Input,
>                         .mElement = busNumber
> };
>
> AudioUnitParameterInfo parameterInfo = {};
> UInt32 parameterInfoSize = sizeof(AudioUnitParameterInfo);
> error = AudioUnitGetProperty(parameter.mAudioUnit,
> kAudioUnitProperty_ParameterInfo, parameter.mScope, parameter.mParameterID,
> &parameterInfo, &parameterInfoSize);
> if (error)
> {
>         return error;
> }
>
> AudioUnitParameterOptions parameterOptions = parameterInfo.flags;
> if ((parameterOptions & kAudioUnitParameterFlag_CanRamp) !=
> kAudioUnitParameterFlag_CanRamp)
> {
>         // parameter cannot be ramped-
>         return paramErr;
> }
>
> AudioUnitParameterEvent parameterEvent = {
>         .scope = parameter.mScope,
>         .element = parameter.mElement,
>         .parameter = parameter.mParameterID,
>         .eventType = kParameterEvent_Ramped,
>         .eventValues.ramp.startBufferOffset = 0,
>         .eventValues.ramp.durationInFrames = durationInFrames,
>         .eventValues.ramp.startValue = startValue,
>         .eventValues.ramp.endValue = endValue
> };
>
> error = AudioUnitScheduleParameters(parameter.mAudioUnit, &parameterEvent,
> 1);
>
>
> Thanks for any help in advance
>
> Benjamin
>
>
> ------------------------------
>
> _______________________________________________
> Coreaudio-api mailing list
> [email protected]
> https://lists.apple.com/mailman/listinfo/coreaudio-api
>
> End of Coreaudio-api Digest, Vol 13, Issue 107
> **********************************************
>



-- 

Marcin
http://google.com/+MarcinRakowskiConnect
_____________________________________
"There are many paths, but only one journey."
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to