Create Stunning Audio Waveform Videos with the myaiteam2/audio-wave-video-maker Actions

24 Apr 2025
Create Stunning Audio Waveform Videos with the myaiteam2/audio-wave-video-maker Actions

In today's digital landscape, visual storytelling is becoming increasingly important, and what better way to enhance your audio content than by creating engaging visualizations? The myaiteam2/audio-wave-video-maker offers developers a powerful Cognitive Action that allows you to generate captivating audio waveform videos. With customizable parameters such as color, thickness, and overlay text, you can create unique visual experiences that complement your audio tracks and captivate your audience.

Prerequisites

Before you start using the Cognitive Actions, ensure you have the following prerequisites:

  • An API key for the Cognitive Actions platform, which you will need for authentication when making requests.
  • Basic knowledge of JSON and RESTful API concepts.

For authentication, you will typically pass your API key in the request headers. This ensures that your application can securely communicate with the Cognitive Actions service.

Cognitive Actions Overview

Generate Audio Wave Video

The Generate Audio Wave Video action enables you to create a video visualization of audio waveforms. You can customize various parameters such as bar color, thickness, and even add an album cover and text overlay to make your video stand out.

  • Category: video-generation

Input

The action requires a composite request with the following fields:

  • audio (required): The URL of the audio file from which to generate the waveform.
  • barColor (optional): Hexadecimal color code for the waveform bars (default: #ffffff).
  • barThickness (optional): The relative width of each bar in the waveform (default: 0.4).
  • numberOfBars (optional): The total number of bars to display in the waveform (default: 100).
  • albumCoverImage (optional): URL to the album cover image.
  • backgroundColor (optional): Hexadecimal color code for the background of the waveform (default: #000000).
  • videoCaptionText (optional): Text caption to overlay on the video (default: "").
  • foregroundOpacity (optional): Opacity level of the waveform's foreground (default: 0.75).
  • videoResolutionWidth (optional): The width of the resulting video in pixels (default: 1280).
  • videoResolutionHeight (optional): The height of the resulting video in pixels (default: 720).
Example Input
{
  "audio": "https://replicate.delivery/pbxt/KbyNolGuw4aWDXQH4UMfq91DAp2yN59ofmMn6QmoU5Pcb3qF/Beast%20Mode.mp3",
  "barColor": "#FA5A82",
  "barThickness": 0.4,
  "numberOfBars": 100,
  "albumCoverImage": "https://replicate.delivery/pbxt/Kbwg3vmrsKQravDqZVCdePkUHELUeiT0rg0xCuS6oxPELdv7/Beast%20mode.jpeg",
  "backgroundColor": "#000000",
  "videoCaptionText": "Beast Mode - Half Human, Half Robot",
  "foregroundOpacity": 0.75,
  "videoResolutionWidth": 1280,
  "videoResolutionHeight": 720
}

Output

Upon successful execution, the action returns a URL to the generated video file.

Example Output
https://assets.cognitiveactions.com/invocations/68691663-c531-4bda-8ecb-7f6e4890f505/573c7bb1-74d6-443c-b0b7-08adab5e16fe.mp4

Conceptual Usage Example (Python)

Below is a conceptual Python snippet demonstrating how to call the Generate Audio Wave Video action.

import requests
import json

# Replace with your Cognitive Actions API key and endpoint
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"  # Hypothetical endpoint

action_id = "4ba73742-b317-4ea8-a679-28d818db131c"  # Action ID for Generate Audio Wave Video

# Construct the input payload based on the action's requirements
payload = {
    "audio": "https://replicate.delivery/pbxt/KbyNolGuw4aWDXQH4UMfq91DAp2yN59ofmMn6QmoU5Pcb3qF/Beast%20Mode.mp3",
    "barColor": "#FA5A82",
    "barThickness": 0.4,
    "numberOfBars": 100,
    "albumCoverImage": "https://replicate.delivery/pbxt/Kbwg3vmrsKQravDqZVCdePkUHELUeiT0rg0xCuS6oxPELdv7/Beast%20mode.jpeg",
    "backgroundColor": "#000000",
    "videoCaptionText": "Beast Mode - Half Human, Half Robot",
    "foregroundOpacity": 0.75,
    "videoResolutionWidth": 1280,
    "videoResolutionHeight": 720
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json"
}

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json={"action_id": action_id, "inputs": payload}  # Hypothetical structure
    )
    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully:")
    print(json.dumps(result, indent=2))

except requests.exceptions.RequestException as e:
    print(f"Error executing action {action_id}: {e}")
    if e.response is not None:
        print(f"Response status: {e.response.status_code}")
        try:
            print(f"Response body: {e.response.json()}")
        except json.JSONDecodeError:
            print(f"Response body: {e.response.text}")

In this code snippet, you will need to replace "YOUR_COGNITIVE_ACTIONS_API_KEY" with your actual API key. The payload includes the required and optional parameters needed for generating the audio waveform video.

Conclusion

The myaiteam2/audio-wave-video-maker Cognitive Action provides an exciting opportunity for developers to create visually stunning audio waveform videos. By leveraging customizable features, you can enhance your audio content and create engaging visual experiences for your audience. Start integrating this action into your applications today, and unlock a new dimension of creativity in your projects!