Re: More than 1 bus in a Node creating distorded audio?
Re: More than 1 bus in a Node creating distorded audio?
- Subject: Re: More than 1 bus in a Node creating distorded audio?
- From: Gregory Wieber <email@hidden>
- Date: Wed, 25 Aug 2010 10:31:42 -0700
While true that one should avoid heavy objective-c messaging in a render callback, in my experience using too much objective-c will result in no audio at all rather than clipping. A simple example is to add one or two NSLogs in a render callback... silence...
Agreed though, without more info about the class that's providing the packets we can only really guess here. My guess is that if everything after bus 2 is coming out of one channel, then you're probably overloading that channel. Maybe try making your code mono first, see if you can get rid of the clipping by keeping all of the busses below a certain amplitude, and then re-code to do stereo?
On Tue, Aug 24, 2010 at 7:24 AM, Kyle Sluder
<email@hidden> wrote:
On Aug 24, 2010, at 2:55 AM, Patrick Muringer <
email@hidden> wrote:
>
> if(inBusNumber == 0) {
> if(input.isPlayingTrack1) {
> [input fillBufferWithSampleForBus0:inNumberFrames :frameBuffer];
General wisdom is not to use ObjC in a render callback. In certain cases, method dispatch can lock, leading to missed realtime thread deadlines and corrupted audio.
>
> //loop through the buffer and fill the frames
> packetCount = (int)[self.sample1 getPacketCount];
> packetIndex = (int)[self.sample1 getIndex];
ObjC style note: the "get" prefix is reserved for returning values by reference. Regular accessors do not begin with "get." Using "get" breaks KVC. See -[NSString getCharacters:] for an appropriate use of "get."
>
> So I guess I'm filling the buffer for each bus.
Guessing isn't helpful, and since we don't have the source to whatever class you're using to get your sample data, that's all we can do too. Have you stepped through your code in the debugger and proven that your buffers are indeed being filled with the appropriate sample data?
--Kyle Sluder _______________________________________________
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