Revised Question -was- Re: Basic Audio Mixer question
Revised Question -was- Re: Basic Audio Mixer question
- Subject: Revised Question -was- Re: Basic Audio Mixer question
- From: Cara Quinn <email@hidden>
- Date: Tue, 02 Feb 2016 15:03:11 -0700
Hi Christian,
Thanks for your note.
Thanks for taking time to really spell things out. I do understand the aspects you went over.
Actually, I think perhaps my question is just not translating well so I will rephrase it completely so it makes better sense.
In the Apple example project UsinganAUGraphwiththeMulti-ChannelMixerandRemoteIOAudioUnit, where, exactly, is the output of each audio file being linked to a specific mixer input bus? Where in code, is it being decided that one particular audio file’s output is always being routed to one of the mixer’s busses? If I wanted to perhaps switch the mixer bus that that audio file is being sent to, where exactly would I do that in this particular example?
Does this make sense?
I think this may be the simplest way I can ask this so hopefully this makes better sense now. :)
You can find the project at:
https://developer.apple.com/library/ios/samplecode/iOSMultichannelMixerTest/Introduction/Intro.html
Thanks so much to all who have responded to me so far. I really appreciate your time and patience.
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:22 PM, Christian Rober <email@hidden> wrote:
Cara,
A couple of things that may help you (apologies if you already know this):
1) Assuming you are using an AUGraph, each node in the graph (except the RemoteI/O or an audio hardware node) will need something connected to its input and have its output connected to some other node (for the pull model to work).
2) The input to an AUGraph node can be either A) another single AUGraph node (i.e. an audio unit), B) multiple AUGraph nodes, or C) a rendering callback function.
3) The ASBD's (which include channel count) must match on the connected buses.
4) If a translation of format, or a channel count change, is required, you may need to insert an audio unit in-between two AUGraph nodes so that the respective I/O's match.
So in your case, you probably want a mixture of the input from the microphone and the audio stream from the network (if I read your requirements accurately). This means one input bus of your mixer would be hooked up to the RemoteI/O's mic "output" bus, (and the ASBD's must match, of course) and the other mixer bus would be hooked up to another audio unit that has the audio from the network. In other words, implementing your own audio unit(s) for the incoming network multi-channel/bus is a solution that allows you to connect the microphone AND other audio to the mixer via AUGraph node connection API.
It might look something like this:
|mic AU| ---> | Bus(0) |
| MultiChannelMixer AU |---> | RemoteI/O output AU |
|net AU| ---> | Bus(1) |
Take a look at this Apple code sample for how to connect nodes to one another and how to setup audio callbacks (look at initializeAUGraph: in particular)
https://developer.apple.com/library/ios/samplecode/iOSMultichannelMixerTest/Listings/Classes_MultichannelMixerController_mm.html#//apple_ref/doc/uid/TP40016060-Classes_MultichannelMixerController_mm-DontLinkElementID_4
At some point you may need something a little bit more sophisticated than the multi-channel mixer. I recommend searching the archives of this list for more information about the Matrix Mixer AU (which is what I use most of the time).
I hope that helps.
--Christian
On Mon, Feb 1, 2016 at 1:50 PM, Cara Quinn <email@hidden> wrote:
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
_______________________________________________
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