Skip to main content

crop

crop(
@start 0
@end 1000
@timeunit 0
) -> llll

Generates an audio process operation for cropping a buffer.


Arguments

  • @start [int/float]: Start time. (default: 0).
  • @end [int/float]: End time. if negative, it counts from the end. (default: 1000).
  • @timeunit [int]: Time unit for @start and @end. (default: 0).
    • 0: Milliseconds
    • 1: Samples
    • 2: Duration ratio
    • 3: Milliseconds difference
    • 4: Samples difference

Output

Crop operation [llll]


Usage

crop is meant to be used with the process function:

$buffer = importaudio('singing.wav'); ## input buffer
$op = crop(@start 1000 @end 2000); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.view('after crop process')