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.
| Property | Type | Description |
|---|---|---|
src | string | URL of the audio file. Required. |
start | number | Trim start time in seconds. Required. |
end | number | Trim end time in seconds. Required. |
duration | number | Total duration of the source audio file in seconds. Required. |
volume | number | Playback 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).