ForHosting KIT · Audio & Voice

Audio fade envelope calculator

This audio fade envelope calculator converts a clip duration and two fade lengths into the exact time-and-gain points needed for a linear volume envelope.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

It marks silence, full gain, the steady section, and the final fade to silence while removing redundant points at identical times. The result is deterministic and ready to adapt for an editor, automation script, rendering pipeline, or validation step. If the requested fades overlap beyond the available clip duration, the calculation stops with a clear input error instead of returning an impossible envelope.

Turn three timing values into an unambiguous envelope

An audio fade is simple to describe but surprisingly easy to encode inconsistently. This calculator accepts the total clip duration, the fade-in length, and the fade-out length, all in seconds. It returns an ordered list of breakpoints where each point contains a time and a linear gain. A gain of zero means silence, while a gain of one means the original signal level. When a fade-in is present, the envelope begins at zero and reaches one at the end of that fade. When a fade-out is present, it remains at one until the fade-out start and then reaches zero at the clip end. A downstream editor or renderer can interpolate linearly between consecutive points. Zero-length fades are handled explicitly, so a clip without a fade-in starts at full gain and a clip without a fade-out ends at full gain. Coincident points are merged, keeping the result compact and preventing duplicate timestamps from creating ambiguous automation behavior.

Understand the overlap rule and boundary cases

The fade lengths share one finite timeline, so their sum cannot be greater than the clip duration. If that sum exceeds the duration, the fade-in would still be rising after the fade-out had already needed to begin, and a simple full-gain linear envelope would have no valid steady or meeting point. The capability rejects that case as invalid input. Equality is valid: when the two fades exactly fill the clip, the fade-in reaches full gain at the same instant that the fade-out begins. The calculator represents that shared instant once. Each numeric field must be finite; values such as infinity, not-a-number values, strings, and missing fields are rejected. Duration must be greater than zero, while either fade may be zero. These rules make edge behavior predictable for automated pipelines and keep invalid timing data from reaching an audio engine where it might otherwise be clipped, silently rearranged, or interpreted differently by different tools.

Use the breakpoints in editing and rendering workflows

The returned points describe a normalized gain envelope rather than samples or decibels, which makes them portable. You can map time values to an editor timeline, convert linear gain to decibels when a target system requires it, or generate automation commands for an offline renderer. The output does not modify audio and does not inspect a media file; it only calculates the control geometry from the supplied timing values. That separation is useful in systems that plan edits before media is uploaded, validate user settings in a form, or store a compact edit decision list for later rendering. Preserve the point order and interpolate between adjacent gains for a linear fade. If your engine uses milliseconds, multiply every returned time by one thousand at the integration boundary rather than changing the meaning of the input. If it uses curves such as equal-power or logarithmic fades, treat these breakpoints as timing anchors and apply the desired curve between them; the endpoint gains and overlap validation remain useful.

Build editor automation

Convert form values into ordered linear-gain keyframes that an audio or video editor can place on a clip timeline.

Validate a rendering job

Reject impossible overlapping fade settings before a queued renderer spends time loading and processing the source media.

Store portable edit decisions

Save a small normalized envelope that can later be adapted to seconds, milliseconds, decibels, or engine-specific automation commands.

What does the gain value mean?

Gain is linear and normalized: zero is silence and one is the unchanged source level. Values between them are obtained by linear interpolation.

Can the fade-in and fade-out meet exactly?

Yes. Their lengths may add up exactly to the clip duration, producing one shared full-gain breakpoint where the fades meet.

What happens when a fade length is zero?

A zero fade is omitted as a ramp. The corresponding clip boundary has full gain, and no redundant breakpoint is added.

Does this process or upload an audio file?

No. It performs a deterministic timing calculation from three numbers and neither reads nor changes audio media.

How much does the API request cost?

Each API request costs $0.002. The browser version runs locally and produces the same envelope calculation.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/audio/fade-in-out

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/audio/fade-in-out \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"duration":12,"fade_in":2.5,"fade_out":3}'
{
  "duration": 12,
  "fade_in": 2.5,
  "fade_out": 3
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "audio.fade_in_out",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb200
max_minutes180
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →