Automotion docs

Audio element

Plays an audio track. Audio elements have timing but no visual presence — use them for background music and sound effects (movie-level audio spans scenes).

Plays an audio track. Audio elements have timing but no visual presence — use them for background music and sound effects (movie-level audio spans scenes).

Properties

PropertyTypeDefaultDescription
id *string (non-empty)Stable identifier, unique across the whole movie. Used by editor selection sync and error paths.
startnumber (≥ 0)0When the element appears, in seconds relative to its scene (or to the movie for movie-level elements).
durationnumber (> 0)How long the element is active, in seconds. Defaults to the remainder of its scene.
type *"audio"An audio track.
src *string (non-empty)Image source URL. Provide exactly one of "src" or "generate".
trimobjectPortion of the source media to play.
volumenumber (0–1)1Playback volume from 0 (silent) to 1 (full).
fadeInnumber (≥ 0)0Fade-in length in seconds.
fadeOutnumber (≥ 0)0Fade-out length in seconds.

trim object

Portion of the source media to play.

PropertyTypeDefaultDescription
start *number (≥ 0)Offset into the source media to start playing from, in seconds.
duration *number (> 0)Length of source media to play, in seconds.

Example

Audio: background music with fade in/out across the movie:

movie.json
{
  "schema": "v1",
  "preset": "9:16",
  "elements": [
    {
      "id": "music",
      "type": "audio",
      "src": "https://assets.example.com/audio/upbeat.mp3",
      "volume": 0.4,
      "fadeIn": 1,
      "fadeOut": 2
    }
  ],
  "scenes": [
    {
      "id": "one",
      "duration": 4,
      "elements": [
        {
          "id": "one-text",
          "type": "text",
          "text": "Scene with music"
        }
      ]
    },
    {
      "id": "two",
      "duration": 4,
      "elements": [
        {
          "id": "two-text",
          "type": "text",
          "text": "Music keeps playing"
        }
      ]
    }
  ]
}

▶ Try it in the playground

On this page