ringtone
Cuts the fragment from `trim_start` to `trim_end` out of an uploaded song, optionally removes ranges inside it, adds fades and a level change, and encodes it as a ringtone — the server lane of the site's /ringtone. `device` caps the length the way phones do: iphone at 40 s, notification at 10 s, counted from `trim_start`; android has no cap. m4r is the iPhone ringtone file (AAC 256 kbit/s). Stage the input with POST /v1/uploads first. ASYNCHRONOUS: the call returns 202 with a run id — poll GET /v1/runs/{id}, or register a webhook.
v1 beta server · 10 tokens
Price (server): 2 tokens per MB of input, at least 10 per call; paid plans: −5%, rounded up. The exact figure for your file: POST /v1/tools/ringtone/estimate.
Call it
POST https://tembrica.com/v1/tools/ringtone/runs
Authorization: Bearer $TIMBRICA_KEY
Idempotency-Key: <your retry-safe key>
Content-Type: application/json
Input
| Field | Type | Required | Notes |
|---|---|---|---|
audio | object | yes | Staged input file, up to 50 MB. Any audio file, or a video whose sound track is taken: mp3, wav, ogg, flac, aac, m4a, webm, aiff, wma, opus, mp4, mov, 3gp, caf, mp2, ac3, amr. Upload it with POST /v1/uploads (multipart `file`, or JSON {"url":"…"}). |
device | string | no |
Where the ringtone goes. iphone caps the length at 40 s, notification at 10 s; android does not cap.
one of: iphone, android, notification default: iphone |
format | string | no |
Output format. m4r for iPhone; mp3 is what Android takes.
one of: m4r, mp3, m4a, ogg, wav, flac, aac, opus, wma, aiff, webm default: m4r |
trim_start | number | no |
Start of the fragment, seconds.
default: 0 |
trim_end | number | no | End of the fragment, seconds. Omit to run to the end (or to the device cap). |
cut_regions | array | no | Ranges inside the fragment to remove, {start, end} in seconds of the original. |
fade_in | number | no | Fade-in length, seconds. |
fade_out | number | no | Fade-out length, seconds. |
volume | number | no |
Linear gain: 1 = unchanged, 2 ≈ +6 dB. Not limited — a loud song raised clips.
default: 1 |
Input file
Stage it with POST /v1/uploads (multipart `file`, or JSON {"url": "…"}), then pass {"file_id": "<id>"} in each listed input field.
file fields: audio
Errors it can return
validation_failed
input_too_large
insufficient_tokens
concurrency_limited
internal_error
History
- v1 — 2026-11-19 — Initial release (server lane, async, per-MB pricing).
This contract cannot change without a new version and a line above: a test compares the published schema, pricing and limits against a committed lockfile and fails the build otherwise. Subscribe to /v1/changelog to be told when something moves.