Skip to main content

Delete

Deletes an audio segment and all of its predecessor segments from memory, freeing up system resources.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Audio Segment ID - The ID of the audio segment to delete along with its predecessors.

Options

This node does not have any configurable options.

Output

This node does not produce output variables. It performs a cleanup operation in memory.

How It Works

The Delete node performs recursive deletion of audio segments to free memory. When executed, the node:

  1. Validates that the segment ID is not empty
  2. Retrieves the segment from the internal audio graph
  3. Identifies all predecessor segments in the processing chain
  4. Recursively deletes the specified segment and all its predecessors
  5. Removes all related nodes from the audio processing graph
  6. Frees the memory occupied by these segments

Understanding the Deletion Process

The audio processing package maintains a dependency graph of all segments:

  • When you create a segment from a file, it has no predecessors
  • When you slice, concatenate, or speed up a segment, the new segment depends on the original(s)
  • Delete removes a segment and everything that led to its creation

Example Dependency Chain

Original Audio (A) → Sliced (B) → Sped Up (C) → Final (D)

If you delete segment D, it will also delete C, B, and A.

Requirements

  • Valid audio segment ID (from Create, Slice, Concatenate, Speedup, etc.)
  • Segment must exist in memory

Error Handling

The node will return specific errors in the following cases:

  • Audio segment ID is empty or null
  • Audio segment with the specified ID does not exist
  • Audio segment has already been deleted

Usage Examples

Example 1: Basic Cleanup

Delete a processed segment after exporting:

  1. Use Create to load audio (outputs segment_id_1)
  2. Use Export to save the audio
  3. Use Delete with segment_id_1 to free memory

Example 2: Intermediate Segment Cleanup

Clean up segments during multi-step processing:

  1. Create segment from file.mp3 (segment_id_1)
  2. Slice segment (segment_id_2)
  3. Speedup sliced segment (segment_id_3)
  4. Export final segment
  5. Delete segment_id_3 (removes segments 1, 2, and 3)

Example 3: Conditional Cleanup

Delete segments only when processing is complete:

  1. Process audio segments
  2. Use Condition node to check if processing succeeded
  3. If successful, delete segments to free memory
  4. If failed, keep segments for debugging

Example 4: Batch Processing Cleanup

Clean up after each iteration in a loop:

  1. Loop through audio files
  2. Create segment for each file
  3. Process segment
  4. Export result
  5. Delete segment before next iteration

Usage Notes

  • Delete is a destructive operation - segments cannot be recovered once deleted
  • The node deletes the entire dependency chain leading to the specified segment
  • Only delete segments after you've exported or finished using them
  • Deleting a segment makes its ID invalid for future operations
  • Memory is immediately freed when segments are deleted
  • Use Delete at the end of your audio processing workflows
  • In loops, delete segments to prevent memory buildup

Memory Management Strategy

When to Delete Segments

  1. After Export: Once you've saved the final audio, delete segments
  2. During Loops: Delete segments at the end of each iteration
  3. Intermediate Results: Delete temporary segments you no longer need
  4. Error Recovery: Delete partial results when operations fail

When NOT to Delete Segments

  1. Active Processing: Don't delete segments still being used
  2. Multiple Outputs: Keep segments if you need to export multiple times
  3. Conditional Logic: Keep segments if different branches need them
  4. Debugging: Keep segments when troubleshooting workflows

Performance Considerations

  • Large audio files consume significant memory
  • Deleting segments improves performance by freeing RAM
  • In batch processing, memory can accumulate quickly without cleanup
  • Regular cleanup prevents out-of-memory errors
  • Delete operations are very fast (milliseconds)

Understanding the Dependency Graph

The audio processing package tracks relationships between segments:

Segment A (original file)

Segment B (sliced from A)

Segment C (concatenated with another)

Segment D (sped up)

Deleting D removes the entire chain (D, C, B, A).

Common Use Cases

  • Freeing memory after exporting processed audio
  • Cleaning up intermediate segments in complex workflows
  • Preventing memory buildup in batch processing loops
  • Removing temporary segments created for calculations
  • Managing memory in long-running automation flows
  • Cleanup after error recovery
  • Resetting audio processing state
  • Optimizing resource usage in production environments

Best Practices

  • Always delete segments when you're done processing
  • Delete segments at the end of loop iterations
  • Use try-catch patterns with cleanup in finally blocks
  • Plan your workflow to minimize the number of segments in memory
  • Delete the final/newest segment to clean up the entire chain
  • Document which segments are deleted in complex flows
  • Test memory usage during development
  • Monitor memory in production environments

Error Recovery Patterns

Safe Cleanup Pattern

1. Create segment
2. Process segment
3. Try:
- Export result
4. Catch:
- Log error
5. Finally:
- Delete segment (cleanup happens regardless of success/failure)

Memory Optimization Tips

  • Delete segments immediately after they're no longer needed
  • In batch processing, delete after each file to maintain constant memory usage
  • For large files, process in chunks and delete chunks as you go
  • Consider file size when planning deletion strategy
  • Use GetMetadata to understand segment memory footprint
  • Monitor system memory during long-running processes

Integration with Other Nodes

The Delete node works with all audio processing nodes:

  • Create - Delete created segments after processing
  • Concatenate - Delete intermediate segments after combining
  • Slice - Delete original after slicing
  • Speedup - Delete after speed adjustment
  • Export - Delete after saving to file
  • GetMetadata - Delete after extracting information

Important Warnings

Destructive Operation

Once a segment is deleted, it cannot be recovered. Ensure you've exported or saved any needed audio before deletion.

Dependency Chain

Deleting a segment also deletes all its predecessors. Make sure no other part of your flow needs those segments.

Invalid IDs

After deletion, the segment ID becomes invalid. Attempting to use it will result in an error.