speed_change
Adjust the playback speed of clips in Adobe Premiere Pro, with options to modify speed multiplier and maintain audio pitch, enabling precise control over video pacing and effects.
Instructions
Changes the playback speed of a clip.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clipId | Yes | The ID of the clip | |
| maintainAudio | No | Whether to maintain audio pitch when changing speed | |
| speed | Yes | Speed multiplier (0.1 = 10% speed, 2.0 = 200% speed) |
Implementation Reference
- src/tools/index.ts:389-396 (registration)Registers the 'speed_change' tool in the list of available tools, including its name, description, and Zod input schema for validation.name: 'speed_change', description: 'Changes the playback speed of a clip.', inputSchema: z.object({ clipId: z.string().describe('The ID of the clip'), speed: z.number().describe('Speed multiplier (0.1 = 10% speed, 2.0 = 200% speed)'), maintainAudio: z.boolean().optional().describe('Whether to maintain audio pitch when changing speed') }) }
- src/tools/index.ts:1981-2017 (handler)The handler method that executes the speed change by generating and running ExtendScript code via the PremiereProBridge to modify the clip's speed property and optionally preserve audio pitch.private async speedChange(clipId: string, speed: number, maintainAudio = true): Promise<any> { const script = ` try { var clip = app.project.getClipByID("${clipId}"); if (!clip) { JSON.stringify({ success: false, error: "Clip not found" }); return; } var oldSpeed = clip.speed; clip.speed = ${speed}; if (${maintainAudio} && clip.hasAudio && clip.hasAudio()) { clip.maintainAudioPitch = true; } JSON.stringify({ success: true, message: "Speed change applied successfully", clipId: "${clipId}", oldSpeed: oldSpeed, newSpeed: ${speed}, maintainAudio: ${maintainAudio} }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script); }
- src/tools/index.ts:518-519 (registration)Dispatches execution of the 'speed_change' tool to its handler method in the executeTool switch statement.case 'speed_change': return await this.speedChange(args.clipId, args.speed, args.maintainAudio);
- src/tools/index.ts:392-396 (schema)Defines the input schema using Zod for parameter validation: clipId (string), speed (number), maintainAudio (optional boolean).clipId: z.string().describe('The ID of the clip'), speed: z.number().describe('Speed multiplier (0.1 = 10% speed, 2.0 = 200% speed)'), maintainAudio: z.boolean().optional().describe('Whether to maintain audio pitch when changing speed') }) }