Gain envelope
A fade is a per-sample volume curve applied to the whole file. Every sample is multiplied by a gain that starts at zero, rises to full level across the fade-in duration, holds there, then falls back to zero across the fade-out duration. Because this only scales amplitudes, the output keeps the input's exact length, sample rate, and channel layout - nothing is cut, shifted, or resampled.