Skip to content

Audio Item

Adds an audio track to the timeline. Audio items have no visual representation on the canvas but are visible in the timeline.

Creating an Audio Item

tsx
const { addItem } = useStudio()

addItem('Audio', {
  width: 200,
  height: 60,
  itemProps: {
    src: 'https://example.com/music.mp3',
    start: 0,
    end: 30,
    duration: 30,
  },
})

Properties

All properties below are passed inside itemProps.

PropertyTypeDescription
srcstringURL of the audio file. Required.
startnumberTrim start time in seconds. Required.
endnumberTrim end time in seconds. Required.
durationnumberTotal duration of the source audio file in seconds. Required.
volumenumberPlayback volume from 0 to 1.

Notes

  • Audio items are controlled by the timeline via usePlayer.
  • Multiple audio items can exist simultaneously (e.g. background music + voiceover).

Released under a proprietary license.