• 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: More than 1 bus in a Node creating distorded audio?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More than 1 bus in a Node creating distorded audio?


  • Subject: Re: More than 1 bus in a Node creating distorded audio?
  • From: Patrick Muringer <email@hidden>
  • Date: Tue, 24 Aug 2010 08:55:47 +0200
  • Thread-topic: More than 1 bus in a Node creating distorded audio?

Thanks Bill for your reply,

You are right, my writing was not clear enough.

I add the callbacks for each bus manually:
AUGraphSetNodeInputCallback(graph, MixerNode, 0, &callback);
.
.
.
AUGraphSetNodeInputCallback(graph, MixerNode, N, &callback); should I use
the loop instead?

In the call back, I have a series of IF statements for each bus number
were I either fill with data or with 0:

if(inBusNumber == 0) {
 if(input.isPlayingTrack1) {
  [input fillBufferWithSampleForBus0:inNumberFrames :frameBuffer];
 }
 else {
  [input fillBufferWith0:inNumberFrames :frameBuffer];
 }
}
.
.
if(inBusNumber == N) {
...
}


The fillBufferWithSampleForBus (0 to N) does this:

-(void) fillBufferWithSampleForBus0:(UInt32)inNumberFrames :(UInt32 *)
frameBuffer {
 int packetCount;
 int packetIndex; //Current position in sample

 //loop through the buffer and fill the frames
 packetCount = (int)[self.sample1 getPacketCount];
 packetIndex = (int)[self.sample1 getIndex];

 self.nbSampleToPlayTrack1 = ((packetCount - packetIndex) <
inNumberFrames)? (packetCount - packetIndex):inNumberFrames;
 for (int j = 0; j < inNumberFrames; j++){
  if(self.nbSampleToPlayTrack1 > 0) {
   frameBuffer[j] = [self.sample1 getNextPacket];
   self.nbSampleToPlayTrack1--;
  }
  else {
   self.isPlayingTrack1=FALSE;
   [self.sample1 reset];
   frameBuffer[j] = 0;
  }
 }
}


So I guess I'm filling the buffer for each bus.

Everything that I "play" on bus 2 and on (correct behavior for busses 0
and 1) is sent clipped only to the left of my headset.
I taught it was the sample so I used the same sample for each bus and I
had the same strange behavior. Anything that I do wrong?

Pat


 _______________________________________________
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: More than 1 bus in a Node creating distorded audio?
      • From: William Stewart <email@hidden>
    • Re: More than 1 bus in a Node creating distorded audio?
      • From: Kyle Sluder <email@hidden>
References: 
 >Re: More than 1 bus in a Node creating distorded audio? (From: William Stewart <email@hidden>)

  • Prev by Date: Re: Audio Queue Recording and Playing at the same time?
  • Next by Date: Re: kAudioDevicePropertyDeviceIsAlive property
  • Previous by thread: Re: More than 1 bus in a Node creating distorded audio?
  • Next by thread: Re: More than 1 bus in a Node creating distorded audio?
  • Index(es):
    • Date
    • Thread