Skip to main content
Glama

add_audio_keyframes

Apply precise audio keyframes to clips in Adobe Premiere Pro for customizable volume adjustments. Define time and dB levels to automate dynamic audio changes.

Instructions

Adds keyframes to audio levels for dynamic volume changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clipIdYesThe ID of the audio clip
keyframesYesArray of keyframe data

Implementation Reference

  • The handler function that executes the 'add_audio_keyframes' tool. It generates an ExtendScript that finds the audio clip, accesses its Volume property, and adds keyframes at specified times with given levels.
    private async addAudioKeyframes(clipId: string, keyframes: Array<{time: number, level: number}>): Promise<any> { const script = ` try { var clip = app.project.getClipByID("${clipId}"); if (!clip) { JSON.stringify({ success: false, error: "Clip not found" }); return; } var audioComponent = clip.components[0]; if (!audioComponent || !audioComponent.properties["Volume"]) { JSON.stringify({ success: false, error: "Audio component not found or clip has no audio" }); return; } var volumeProperty = audioComponent.properties["Volume"]; var addedKeyframes = []; ${keyframes.map(kf => ` try { volumeProperty.addKey(new Time("${kf.time}s")); volumeProperty.setValueAtKey(new Time("${kf.time}s"), ${kf.level}); addedKeyframes.push({ time: ${kf.time}, level: ${kf.level} }); } catch (e) { // Keyframe already exists or invalid time } `).join('\n')} JSON.stringify({ success: true, message: "Audio keyframes added successfully", clipId: "${clipId}", addedKeyframes: addedKeyframes, totalKeyframes: addedKeyframes.length }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script); }
  • The input schema definition for the 'add_audio_keyframes' tool, using Zod for validation.
    { name: 'add_audio_keyframes', description: 'Adds keyframes to audio levels for dynamic volume changes.', inputSchema: z.object({ clipId: z.string().describe('The ID of the audio clip'), keyframes: z.array(z.object({ time: z.number().describe('Time in seconds'), level: z.number().describe('Audio level in dB') })).describe('Array of keyframe data') }) },
  • The switch case in executeTool that registers and dispatches to the addAudioKeyframes handler.
    case 'add_audio_keyframes': return await this.addAudioKeyframes(args.clipId, args.keyframes);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hetpatel-11/Adobe_Premiere_Pro_MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server