trim
trim(
@threshold 0.01
@ampunit 0
@start 1
@end 1
) -> llll
Generates an audio process operation for applying silence-based trimming to a buffer. When the entire buffer is considered silent, the resulting buffer's duration will be a single audio sample.
Arguments
@threshold
[int/float]: Amplitude threshold at/below which samples are considered silence. (default:0.01
).@ampunit
[int]: Amplitude unit for@threshold
. (default:0
).0
: Linear1
: Decibels
@start
[int/float]: Trim the beginning of the buffer. (default:1
).0
: Off1
: On
@end
[int/float]: Trim the end of the buffer. (default:1
).0
: Off1
: On
Output
Join operation [llll]
Usage
trim
is meant to be used with the process
function:
$buffer = importaudio('singing.wav'); ## input buffer
$op = trim(); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.view('after trim process')