Re: Basic Audio Mixer question
Re: Basic Audio Mixer question
- Subject: Re: Basic Audio Mixer question
- From: Cara Quinn <email@hidden>
- Date: Mon, 01 Feb 2016 11:50:46 -0700
Hi Larissa,
yes, this is in the callback. From what I am understanding though, this is not actually distinguishing between audio sources though.
I.E. outA and outB are being processed each time the callback is called regardless of which audio file is currently being processed in the callback. In other words, the conditional is checking to see if the inBusNumber is 1 and then simply manually panning the incoming audio based on that. If one were to remove the if statement and simply not 0 out one of the incoming buffers the audio from both files would still play but would simply not be panned to one side. It would just play in the center of the stereo field.
So this is not actually saying that one audio file is guaranteed to be coming into the mixer on a predefined input buss.
Does this make sense?
I was able to modify this code to use the pan control on each mixer input bus and eliminate the manual panning that is going on in this example but I am just not seeing where the incoming audio data is being assigned to a specific input bus.
Perhaps there is no assignment going on here and the two files are simply being assigned at runtime internally?
Perhaps I should just be asking, is it possible to assign an audio source such as the files in this example to specific mixer inputs?
I.E. How can I always be sure that one audio file is always going to come into the mixer unit on bus 0 whereas the second file is always going to come into the mixer on bus 1?
I think this is a much better and clearer question. Am I making sense? :)
Cheers!
Cara
---
iOS design and development - LookTel.com
---
View my Online Portfolio at:
http://www.onemodelplace.com/models/Cara-Quinn
Follow me on Twitter!
https://twitter.com/ModelCara
On Feb 1, 2016, at 11:07 AM, Larissa Laich <email@hidden> wrote:
Hi Cara,
I looked through the example you described (UsinganAUGraphwiththeMulti-ChannelMixerandRemoteIOAudioUnit). In the following section it is decided wich audio data is played:
Float32 *outA = (Float32 *)ioData->mBuffers[0].mData; // output audio buffer for L channel
Float32 *outB = (Float32 *)ioData->mBuffers[1].mData; // output audio buffer for R channel
// for demonstration purposes we've configured 2 stereo input busses for the mixer unit
// but only provide a single channel of data from each input bus when asked and silence for the other channel
// alternating as appropriate when asked to render bus 0 or bus 1's input
for (UInt32 i = 0; i < inNumberFrames; ++i) {
if (1 == inBusNumber) {
outA[i] = 0;
outB[i] = in[sample++];
} else {
outA[i] = in[sample++];
outB[i] = 0;
}
if (sample > bufSamples) {
// start over from the beginning of the data, our audio simply loops
printf("looping data for bus %d after %ld source frames rendered\n", (unsigned int)inBusNumber, (long)sample-1);
sample = 0;
}
}
Larissa
> Am 01.02.2016 um 18:52 schrieb Cara Quinn <email@hidden>:
>
> Larissa,
>
> Thank you very much for this.
>
> I understand the concept of connecting nodes in an auGraph, so your code makes perfect sense.
>
> What I have not seen in the sample code is how to assign a specific audio stream to a specific mixer input element.
>
> If you like, please see my earlier note to Mahboud for some clarification on what I am doing.
>
> Let me revisit the AUGraphConnectNodeInput function to see if I am overlooking something basic here and perhaps I can find what I need or at least ask a better question.
>
> I sure don’t want to waste your and others time. :)
>
> Thanks so much for your note. You may have given me the direction I need.
>
> Cheers!
>
> Cara
> ---
> iOS design and development - LookTel.com
> ---
> View my Online Portfolio at:
>
> http://www.onemodelplace.com/models/Cara-Quinn
>
> Follow me on Twitter!
>
> https://twitter.com/ModelCara
>
> On Feb 1, 2016, at 5:05 AM, Larissa Laich <email@hidden> wrote:
>
> Hi Cara,
>
> I create a mixer node with kAudioUnitSubType_MultiChannelMixer in the audio component description. When you say "channel“, are you talking about elements?
> An element is a programmatic context which is nested within an audio scope. It is analogous to a signal bus in a physical device (if it is a part of input or output scope) and that’s the reason why it is sometimes also called a bus.
>
> For example you can connect your output node (bus 0 (in output scope) is directly connected to the speaker) with your mixer node like that:
>
> CheckError(AUGraphConnectNodeInput(self->graph, mainMixerNode, 0, outputNode, 0),
> "Couldn't connect mixer output on bus 0 to input scope bus 0 of outputNode");
>
> Best,
> Larissa
>
>
>
>> Am 01.02.2016 um 05:46 schrieb Cara Quinn <email@hidden>:
>>
>> Hello All, firstly thanks for this list!
>>
>> My apologies for such a basic mixer question but I have been tasked with writing a VOIP application and have had no previous experience with audio units until just recently.
>>
>> I am needing to add multi-channel support to the VOIP app at the moment so am researching the standard multi-channel mixer audio unit.
>>
>> I have looked at some sample code (both from Apple and from third parties) to get an idea of what is happening and mostly get what is going on with one exception.
>>
>> I cannot for the life of me, figure out where the channel or bus assignments are happening. I.E. if I have several audio streams, and I wish to assign each stream to a specific mixer input I cannot see where this is happening in any of the examples I am looking at.
>>
>> Also, I have seen people say online that the busses and mixer channels are two different concepts but again, I cannot see in the code where this is demonstrated. So any help on the correct paradigm I should be thinking of this in terms of, would greatly be appreciated.
>>
>> I am sure I must be overlooking something basic here so if anyone can point me in the right direction I would sure be grateful! :)
>>
>> Thanks so much and please do have a great day!
>>
>> Cheers!
>>
>> Cara
>> ---
>> iOS design and development - LookTel.com
>> ---
>> View my Online Portfolio at:
>>
>> http://www.onemodelplace.com/models/Cara-Quinn
>>
>> Follow me on Twitter!
>>
>> https://twitter.com/ModelCara
>>
>>
>> _______________________________________________
>> 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