gain

fun gain(at: Long, frameCount: Long, fadeFrameCount: Long, fadesIn: Boolean, fadesOut: Boolean): Float(source)

Returns the gain for one frame, applying the requested linear edge fades.

A buffer shorter than two frames or a nonpositive fade length returns unity. Frames outside the buffer are clamped to zero when an applicable fade is enabled.