Guide

Audio operations

Adjust volume, normalize, trim and edit audio.

Beyond converting between audio formats, the API can edit and process audio in place: adjust loudness, trim a clip, change codec and quality, or merge several tracks into one. These capabilities are exposed either as dedicated operations (like audio-volume) or as options on a regular audio conversion. Browse every audio target in the format explorer.

Adjust and normalize volume

Use the audio-volume operation to apply a fixed gain or attenuation via the volume option, expressed as a relative decibel value such as "+3dB" or "-6dB".

{
  "input": [{ "type": "remote", "source": "https://example-files.online-convert.com/audio/mp3/example.mp3" }],
  "conversion": [{
    "category": "operation",
    "target": "audio-volume",
    "options": { "volume": "+3dB" }
  }]
}

To even out loudness instead of applying a fixed gain, enable EBU R128 normalization on an audio conversion with normalize, normalize_type and normalize_target_level_ebu.

{
  "input": [{ "type": "remote", "source": "https://example-files.online-convert.com/audio/wav/example.wav" }],
  "conversion": [{
    "category": "audio",
    "target": "mp3",
    "options": {
      "normalize": true,
      "normalize_type": "ebu",
      "normalize_target_level_ebu": -23
    }
  }]
}

Trim audio

Cut a clip to a time range by setting start and end on an audio conversion. Both use HH:MM:SS notation; the segment between them is kept.

{
  "input": [{ "type": "remote", "source": "https://example-files.online-convert.com/audio/mp3/example.mp3" }],
  "conversion": [{
    "category": "audio",
    "target": "mp3",
    "options": {
      "start": "00:00:30",
      "end": "00:01:45"
    }
  }]
}

Codec and quality while editing

When converting or editing audio you can control the output encoding with audio_codec, audio_bitrate, channels (mono or stereo) and the sample rate via frequency.

{
  "input": [{ "type": "remote", "source": "https://example-files.online-convert.com/audio/wav/example.wav" }],
  "conversion": [{
    "category": "audio",
    "target": "aac",
    "options": {
      "audio_codec": "aac",
      "audio_bitrate": 192,
      "channels": "stereo",
      "frequency": 44100
    }
  }]
}
OptionPurposeExample
audio_codecEncoder used for the audio streammp3, aac
audio_bitrateTarget bitrate in kbps192
channelsChannel layoutmono, stereo
frequencySample rate in Hz44100

Submit a job

Send any of the bodies above to the job endpoint, authenticating with the lowercase x-oc-api-key header.

curl -X POST https://api.api2convert.com/v2/jobs \
  -H "x-oc-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d @job.json

Merging audio tracks

To combine multiple audio files into a single track, use the merge-streams capability. See the Video operations guide for the full request structure and supported combinations.

Trim (start/end), normalization and codec options live on an audio conversion target (e.g. "target": "mp3"), while a simple gain change is the dedicated audio-volume operation. Pick whichever matches what you need to change.

Live options

Pick an operation or audio target to see its live options:

Loading options…