ComfyUI > Nodes > ComfyUI_AudioTools > Trim Audio

ComfyUI Node: Trim Audio

Class Name

TrimAudio

Category
🎤MW/MW-Audio-Tools
Author
mw (Account age: 2258days)
Extension
ComfyUI_AudioTools
Latest Updated
2025-05-11
Github Stars
0.03K

How to Install ComfyUI_AudioTools

Install this extension via the ComfyUI Manager by searching for ComfyUI_AudioTools
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_AudioTools in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Trim Audio Description

Extract specific audio segments by defining start and end times, enhancing audio editing efficiency.

Trim Audio:

The TrimAudio node is designed to allow you to extract a specific segment from an audio file by specifying the start and end times. This functionality is particularly useful when you need to isolate a portion of an audio track for further processing or analysis, such as creating audio samples, removing unwanted sections, or focusing on a particular part of a recording. By providing a straightforward method to trim audio, this node enhances your ability to manipulate audio data efficiently, making it an essential tool for audio editing and production tasks.

Trim Audio Input Parameters:

audio

The audio parameter is the input audio data that you want to trim. It is expected to be a dictionary containing two key elements: waveform, which represents the audio signal, and sample_rate, which indicates the number of samples per second. This parameter is crucial as it provides the raw audio data that will be processed by the node.

start_time

The start_time parameter specifies the beginning of the audio segment you wish to extract, measured in seconds. It is a floating-point number with a default value of 0.00, and it must be greater than or equal to 0.00. This parameter allows you to define precisely where the trimmed audio should start, enabling you to focus on the desired portion of the audio track.

end_time

The end_time parameter defines the endpoint of the audio segment you want to extract, also measured in seconds. Like start_time, it is a floating-point number with a default value of 0.00 and must be greater than or equal to 0.00. This parameter is essential for determining the length of the trimmed audio segment, allowing you to capture the exact duration needed for your project.

Trim Audio Output Parameters:

audio

The audio output parameter is the resulting trimmed audio segment. It retains the same structure as the input, being a dictionary with waveform and sample_rate keys. This output provides you with the specific portion of the audio that you defined using the start_time and end_time parameters, ready for further use or analysis in your audio projects.

Trim Audio Usage Tips:

  • Ensure that the start_time and end_time parameters are set correctly to avoid trimming the wrong segment of the audio. Double-check the times to match the desired section.
  • Use the node in conjunction with other audio processing nodes to create a comprehensive audio editing workflow, such as combining it with nodes for audio effects or transformations.

Trim Audio Common Errors and Solutions:

"Start time must be less than end time"

  • Explanation: This error occurs when the start_time is set to a value greater than or equal to the end_time.
  • Solution: Adjust the start_time and end_time parameters to ensure that start_time is less than end_time.

"Invalid audio input format"

  • Explanation: This error indicates that the input audio does not conform to the expected dictionary format with waveform and sample_rate.
  • Solution: Verify that the input audio is correctly formatted as a dictionary with the required keys and that the data types are appropriate.

Trim Audio Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_AudioTools
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.