SSML Builder Documentation - v1.0.1
    Preparing search index...

    Interface BackgroundAudioOptions

    Configuration options for background audio.

    Defines audio that plays throughout the entire SSML document, behind the spoken content. Useful for adding music or ambient sounds.

    const bgAudio: BackgroundAudioOptions = {
    src: 'https://example.com/music.mp3',
    volume: '0.5', // 50% volume
    fadein: '3000ms', // 3-second fade in
    fadeout: '2000ms' // 2-second fade out
    };
    interface BackgroundAudioOptions {
        fadein?: string;
        fadeout?: string;
        src: string;
        volume?: string;
    }
    Index

    Properties

    fadein?: string

    Duration of the fade-in effect at the start.

    Gradually increases volume from 0 to the specified volume level. Specified in milliseconds (ms) or seconds (s).

    "2000ms" - 2-second fade in
    
    "3s" - 3-second fade in
    
    fadeout?: string

    Duration of the fade-out effect at the end.

    Gradually decreases volume from the specified level to 0. Specified in milliseconds (ms) or seconds (s).

    "1500ms" - 1.5-second fade out
    
    "2s" - 2-second fade out
    
    src: string

    URL of the background audio file. (Required)

    Requirements:

    • Must be a publicly accessible HTTPS URL
    • Supported formats: MP3, WAV, and other common audio formats
    • File size limits depend on the service tier
    • Audio automatically loops if shorter than speech duration
    "https://example.com/background-music.mp3"
    
    "https://cdn.example.com/sounds/ambient.wav"
    
    volume?: string

    Volume level of the background audio.

    Can be specified as:

    • Decimal: "0.0" (silent) to "1.0" (full volume)
    • Percentage: "0%" to "100%"
    • Decibels: "+0dB", "-6dB" (negative reduces volume)
    "1.0"
    
    "0.5" - 50% volume
    
    "30%" - 30% volume
    
    "-6dB" - Reduce by 6 decibels