format
format(
@sr -1
@duration -1
@timeunit 0
@numchannels -1
@resample 1
@resamplingfiltersize 11
@resamplingmode 'sinc'
@channelmodedown 3
@channelmodeup 3
) -> llll
Generates an audio process operation for basic buffer formatting, such as changing the number of channels, duration and sample rate.
Arguments
@sr[int]: Sample rate for the buffer. Use-1to keep sample rate or0to use bellplay~'s global sample rate. (default:-1).@duration[int/float]: Target duration, based on@timeunit. Use-1to keep buffer duration. (default:-1).@timeunit[int]: Time unit for@duration. (default:0).0: Milliseconds1: Samples2: Duration ratio3: Milliseconds difference4: Samples difference
@numchannels[int/float]: Target duration, based on@timeunit. Use-1to keep buffer duration. (default:-1).@resample[int]: Resample buffer when@sris different. (default:1).0: Off1: On
@resamplingfiltersize[int]: Resampling filter size. (default:11).@resamplingmode[symbol]: Resampling mode. (default:'sinc').'sinc''nearest neighbor''sample and hold''linear''quad''cubic'
@channelmodedown[int]: Channel conversion mode while downmixing (default:3).0: Delete all samples1: Only keep existing channels2: Pad last channel3: Cyclic repetition of channels while upmixing.4: Palindrome cycling of channels while upmixing.5: Pan channels to new configuration
@channelmodeup[int]: Channel conversion mode while upmixing (default:3).0: Delete all samples1: Only keep existing channels2: Pad last channel3: Cyclic repetition of channels while upmixing.4: Palindrome cycling of channels while upmixing.5: Pan channels to new configuration
Output
Format operation [llll]
Usage
format is meant to be used with the process function:
$buffer = importaudio('singing.wav'); ## input buffer
$op = format(); ## processing operation
$buffer = $buffer.process($op); ## apply processing
$buffer.view('after format process')