• 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: Can anyone help me in Fade In...?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Can anyone help me in Fade In...?
      • From: Howard Moon <email@hidden>
References: 
 >Re: Can anyone help me in Fade In...? (From: Alejandro <email@hidden>)
 >Re: Can anyone help me in Fade In...? (From: Ansh <email@hidden>)

  • Prev by Date: Re: Why get Error kAudioUnitErr_CannotDoInCurrentContext when call AudioUnitRender in InputCallback
  • Next by Date: Re: Current buffer size not in list of driver's supported buffer sizes
  • Previous by thread: Re: Can anyone help me in Fade In...?
  • Next by thread: Re: Can anyone help me in Fade In...?
  • Index(es):
    • Date
    • Thread