Audio Configuration
Multi-track audio support
Audio Configuration
The audio field defines audio sources including background music, voiceovers, and sound effects.
Field Definition
interface AudioConfig {
tracks?: AudioTrack[];
bgm?: {
src: string;
volume?: number;
loop?: boolean;
fadeIn?: number;
fadeOut?: number;
};
}Example
{
"audio": {
"bgm": {
"src": "https://example.com/ambient.mp3",
"volume": 0.4,
"fadeIn": 2,
"fadeOut": 2
},
"tracks": [
{
"id": "voiceover",
"type": "voice",
"src": "https://example.com/voice.mp3",
"volume": 1.0
},
{
"id": "sfx",
"type": "sfx",
"src": "https://example.com/click.mp3",
"volume": 0.5
}
]
}
}Track Types
| Type | Description |
|---|---|
bgm | Background music |
voice | Voiceover or narration |
sfx | Sound effects |
custom | Custom audio track |
Track Properties
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Unique track identifier |
| type | string | Yes | - | Track type (bgm/voice/sfx/custom) |
| src | string | Yes | - | Audio file URL |
| volume | number | No | 1.0 | Volume level (0-1) |
| muted | boolean | No | false | Mute the track |
| loop | boolean | No | false | Loop the audio |
| startTime | number | No | 0 | Start time in seconds |
| fadeIn | number | No | 0 | Fade in duration in seconds |
| fadeOut | number | No | 0 | Fade out duration in seconds |
| playbackRate | number | No | 1.0 | Playback speed multiplier |
| solo | boolean | No | false | Solo this track |