The Audiogram elements allow you to add audio waves to your videos automatically. You can customize the color, size and position of the waves and generate creative audiograms for your podcasts or social media videos.

In the following examples we will see how you can include audiogram elements in our videos.

Simple audiogram

In this example we will add a simple audiogram to a scene:

{
    "resolution": "hd",
    "quality": "high",
    "draft": false,
    "scenes": [
        {
            "comment": "Scene #1",
            "elements": [
                {
                    "type": "audio",
                    "src": "https://assets.json2video.com/assets/audios/mozart-kv525.mp3",
                    "duration": 15
                },
                {
                    "type": "audiogram",
                    "height": 400,
                    "color": "green",
                    "amplitude": 10
                }
            ]
        }
    ]
}

The resulting video is (unmute the player to hear the audio):

The video uses one scene with 2 elements:

In this example, we are overlaying the audiogram at the top-left corner of the video (x=0, y=0 are the default values). The audiogram is set to 400px high, and a relative amplitude of 10.

Two color audiograms

You can overlay two audiograms on top of each other to create a more creative audiogram using different colors, opacities and amplitudes.

Example:

{
    "resolution": "hd",
    "quality": "high",
    "draft": false,
    "scenes": [
        {
            "comment": "Scene #1",
            "elements": [
                {
                    "type": "image",
                    "src": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Wolfgang-amadeus-mozart_1.jpg/440px-Wolfgang-amadeus-mozart_1.jpg",
                    "position": "center-center"
                },
                {
                    "type": "audio",
                    "src": "https://assets.json2video.com/assets/audios/mozart-kv525.mp3",
                    "duration": 15
                },
                {
                    "type": "audiogram",
                    "y": 400,
                    "height": 300,
                    "color": "#f74f43",
                    "opacity": 0.6,
                    "amplitude": 10
                },
                {
                    "type": "audiogram",
                    "y": 400,
                    "height": 300,
                    "color": "white",
                    "opacity": 1,
                    "amplitude": 5
                }
            ]
        }
    ]
}

The resulting video is:

This example uses two audiograms:

Other effects

You can also use other effects to create more creative audiograms, like cropping, fading, scaling or rotating. In the following video, we combine these effects to show how they work.

Example:

{
    "resolution": "hd",
    "quality": "high",
    "draft": false,
    "scenes": [
        {
            "comment": "Scene #1",
            "elements": [
                {
                    "type": "image",
                    "src": "https://images.pexels.com/photos/3944091/pexels-photo-3944091.jpeg",
                    "scale": {
                        "width": 1280,
                        "height": 720
                    },
                    "zoom": 5
                },
                {
                    "type": "audio",
                    "src": "https://json2video-test.s3.amazonaws.com/assets/audios/happy-music-01.mp3",
                    "duration": 15
                },
                {
                    "type": "audiogram",
                    "x": -640,
                    "height": 720,
                    "color": "#f74f43",
                    "opacity": 0.6,
                    "amplitude": 8,
                    "rotate": {
                        "angle": 90
                    }
                },
                {
                    "type": "audiogram",
                    "x": -640,
                    "height": 720,
                    "color": "yellow",
                    "opacity": 0.5,
                    "amplitude": 3,
                    "rotate": {
                        "angle": 90
                    }
                }
            ]
        }
    ]
}

The resulting video is (unmute the player to hear the audio):

This example uses rotates the audiogram vertically and translates it to the left side.