On Aug 2, 2005, at 1:56 PM, Chris Rogers wrote: Evan,
There isn't any latency in the mixer. I'm not sure what's going on here, but you may want to call AudioUnitReset() on the mixer before you start your fade. This deactivates the smoothing de-zippering the first time you make a call to AudioUnitSetParameter() so it will snap to the exact param value.
Chris Rogers Core Audio Apple Computer
OK, I gave it a shot:
On the very start of playback, I told the AUMixer: AudioUnitReset(audioUnit, kAudioUnitScope_Global, 0); ...and nothing was different. The same 256 samples remain untouched.
You can actually SEE this in Wave Editor 1.0rc3: Take an audio file that's, for example, a drum beat - so that there's something pretty audible right at the start. Select a segment starting at the front part of the file and add segmented fade in. ("Layer->Add Fade->Segmented->Fade In"). Play it, and you'll hear the little "clip" right at the front. Flatten the layer, and you'll SEE the untouched audio right at the top. If you measure it with the selection (and have the Time Units set to samples), you'll see that it's exactly 256 samples. (if you see any different number of samples, let me know, I *did* do a fix in 1.0rc4 that I *thought* would help it, and actually might focus the problem a bit more, but I can get the current build out to you).
I've confirmed that the AudioUnitSetParameter call happens before the rendering, and I can confirm it's giving it the right value. I'd blame myself a lot more if it weren't that it happens at 256 samples, which isn't a whole buffer size.
Weird?
Ev Technical Knowledge Officer Head Programmer/Designer Audiofile Engineering
|