Convert audio channel layout
Audio channel labels can look simple while hiding an important routing decision. This capability accepts a source layout and a target layout, then returns the exact deterministic mapping used between mono, stereo, and 5.1.
Run — free
The result identifies every source and destination channel, classifies the operation as an identity, downmix, or upmix, and expresses each output as a readable formula. It is useful for planning pipelines, documenting transcoding behavior, validating configuration, and explaining why a converted file sounds different without uploading or decoding any audio.
Read the mapping before changing the audio
A channel-layout conversion is more than changing a label in a container. Each output speaker needs a defined signal, and careless routing can remove dialogue, duplicate ambience, or create a surprising level increase. Supply source_layout and target_layout using one of the supported names: mono, stereo, or 5.1. The response lists the canonical channels in order and gives one formula for every target channel. Mono uses M; stereo uses L and R; 5.1 uses FL, FR, FC, LFE, SL, and SR. A formula such as 0.5*L + 0.5*R means that both stereo inputs contribute equally to the mono output. The returned rule is a specification, not processed media: this capability does not receive an audio file or alter samples. That makes it suitable for configuration previews, technical documentation, test expectations, and user interfaces that need to explain a conversion before a separate encoder performs it. Layout names are matched without regard to surrounding whitespace or letter case, while unsupported names are rejected instead of guessed.
Understand downmix coefficients and headroom
Downmixing combines more input channels into fewer outputs. Stereo to mono uses half of the left signal plus half of the right signal, preserving a sensible average rather than simply summing both at full level. For a 5.1 to stereo conversion, the front left and front right channels remain on their respective sides. The center contributes to both sides at 0.707, approximately minus three decibels, and each surround contributes to its corresponding side at the same coefficient. The LFE channel is deliberately omitted because it is an effects channel, not a complete bass-only copy of the program, and including it by default can produce excessive low-frequency energy. The 5.1 to mono rule is the stereo rule folded equally into one channel: front left and right each contribute 0.5, the center contributes 0.707, and the surround channels each contribute 0.3535. Several correlated signals can still add beyond full scale. For that reason the response warns that practical rendering may need gain reduction or a limiter. The formulas define routing proportions; they do not promise clipping prevention, loudness normalization, or compliance with every broadcaster's delivery profile.
Treat upmixing as routing, not source separation
Upmixing cannot recover spatial information that was never captured. Mono to stereo therefore duplicates M into L and R. Mono to 5.1 places M in the front center channel and fills the other destinations with silence, which keeps a centered source centered without inventing surround or effects material. Stereo to 5.1 preserves L and R in the front pair, derives the center as an equal half-level combination, copies the left and right signals to their corresponding surrounds, and leaves LFE silent. These choices provide an explicit, reproducible routing plan, but they are not a psychoacoustic surround decoder. A production workflow may choose decorrelation, delay, filtering, bass management, or a matrix standard according to its listening environment; those processes fall outside this result. Conversions where source and target are identical are reported as identity operations, with every channel passing through unchanged. Keeping identity behavior explicit is helpful when one configuration path handles many files and needs an auditable answer even when no remix occurs. Any pair containing a layout other than mono, stereo, or 5.1 returns an invalid-input error, ensuring that unfamiliar arrangements such as 7.1 are never silently treated as something else.
What you can do with it
Document a transcoding preset
Store the returned formulas beside an encoder preset so reviewers can see exactly how each destination channel is derived.
Preview a media workflow
Explain a planned mono, stereo, or 5.1 conversion in a user interface before an audio processor renders the result.
Validate routing expectations
Compare pipeline configuration with a stable mapping and catch omitted dialogue, unexpected surround duplication, or unsupported layouts early.
FAQ
Does this capability convert an audio file?
No. It returns the deterministic channel mapping and formulas that an audio processor can apply; it does not decode, upload, or render media.
Which layouts are supported?
Mono, stereo, and 5.1 are supported as both source and target layouts, including identity conversions.
What happens to LFE in a downmix?
LFE is omitted. It is an effects channel and adding it automatically can create excessive low-frequency energy.
Can a downmix clip?
Yes. Correlated channels may sum above full scale, so the final audio renderer may need headroom, gain reduction, or limiting.
What does it cost?
Each API request costs $0.002. The calculation is deterministic and requires no network service or media upload.
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/audio/channel-layout-convert \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"source_layout":"5.1","target_layout":"stereo"}'const res = await fetch("https://api.kit.forhosting.com/audio/channel-layout-convert", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"source_layout": "5.1",
"target_layout": "stereo"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/audio/channel-layout-convert",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"source_layout": "5.1",
"target_layout": "stereo"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/audio/channel-layout-convert", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"source_layout":"5.1","target_layout":"stereo"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"source_layout":"5.1","target_layout":"stereo"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/audio/channel-layout-convert", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"source_layout": "5.1",
"target_layout": "stereo"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "audio.channel_layout_convert",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_mb | 200 |
max_minutes | 180 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |