Re: Can anyone help me in Fade In...?
Re: Can anyone help me in Fade In...?
- Subject: Re: Can anyone help me in Fade In...?
- From: Richard Dobson <email@hidden>
- Date: Fri, 17 Jul 2009 16:59:17 +0100
Ansh wrote:
I have reduce my algorithm to
- (void)applyFadeInEffectForBuffer:(float *)buffer
ofLength:(int)length
{
* **length = length / sizeof(float);*
* **for (int i = 0; i < length; i ++) {*
* **float factor = (float)( i/(float) length); *
* **buffer[i] = (float)(buffer[i]) * factor;*
* **}*
}
where length is in number of bytes. But still there is a noise in
fade in.
You will need to specify the noise in a little more detail. Note that a
plain linear ramp is less than ideal for an audio fade-in - gets loud
too soon. Try a log or quasi-log (rising exp) curve. A simple one would
be to change:
buffer[i] = (float)(buffer[i]) * factor;
to:
buffer[i] = (float)((buffer[i]) * (factor * factor));
Richard Dobson
_______________________________________________
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