Creating custom volume effect using Tween

I’ve tried to create an audio transition using Tween as follows:

      {
        "clips": [
          {
            "start": 0,
            "length": 11.392,
            "scale": 1,
            "position": "center",
            "fit": "contain",
            "asset": {
              "type": "video",
              "src": "CDN_URL",
              "trim": 38.118,
              "volume": [
                {
                  "from": 0,
                  "to": 1,
                  "start": 0,
                  "length": 5,
                  "interpolation": "linear"
                }
              ]
            }
          }
        ]
      }

But I see no difference in the preview in studio editor, there is no audio effect applied. How can I implement custom volume effect by leveraging Tween object?

Hi @ahmadlatief2611,

Yes, audio animation works, but unfortunately, it’s not supported in the studio editor. However, you can achieve it via the API.

Here’s a simple example and a render where the audio volume varies, with some points set lower than others in this video.

{
  "timeline": {
    "background": "#602424",
    "tracks": [
      {
        "clips": [
          {
            "length": 10,
            "asset": {
              "type": "audio",
              "src": "https://shotstack-ingest-api-v1-sources.s3.ap-southeast-2.amazonaws.com/wddscw6f59/zzz01j1z-pf08a-qa711-bv751-97r0hq/source.mp3",
              "volume": [
                {
                  "from": 0,
                  "to": 1,
                  "start": 0,
                  "length": 2,
                  "interpolation": "linear"
                },
                {
                  "from": 1,
                  "to": 0.2,
                  "start": 2,
                  "length": 1,
                  "interpolation": "linear"
                },
                {
                  "from": 0.2,
                  "to": 1,
                  "start": 3,
                  "length": 2,
                  "interpolation": "linear"
                },
                {
                  "from": 1,
                  "to": 0,
                  "start": 5,
                  "length": 1,
                  "interpolation": "linear"
                },
                {
                  "from": 0,
                  "to": 1,
                  "start": 6,
                  "length": 2,
                  "interpolation": "linear"
                },
                {
                  "from": 1,
                  "to": 0,
                  "start": 8,
                  "length": 2,
                  "interpolation": "linear"
                }
              ]
            },
            "start": 0
          }
        ]
      }
    ]
  },
  "output": {
    "format": "mp4",
    "fps": 25,
    "size": {
      "width": 1080,
      "height": 1920
    },
    "thumbnail": {
      "capture": 1,
      "scale": 1
    }
  },
  "merge": [
    {
      "find": "IMAGE1",
      "replace": "https://shotstack-ingest-api-v1-sources.s3.ap-southeast-2.amazonaws.com/wddscw6f59/zzz01je3-ta3ya-9ezdc-gwaxy-se6tvm/source.webp"
    }
  ]

Let me know if you need further details!