元编程参考文档

编辑

13 个节点

本页内容 13

拼接

函数

Plays one clip after another.

签名
拼接(第一个: AudioBuffer, 第二个: AudioBuffer) -> AudioBuffer
AudioBuffer Concatenate(AudioBuffer first, AudioBuffer second)

参数

名称类型默认值说明
第一个AudioBuffer—The clip that plays first; the result takes its sample rate.
第二个AudioBuffer—The clip that follows it.

返回

音频AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

淡入

函数

Brings a clip in from silence.

签名
淡入 -> AudioBuffer
    音频: AudioBuffer
    时长: 数字
    曲线: Fade Curve
AudioBuffer FadeIn(
    AudioBuffer audio,
    double duration = 0.5,
    FadeCurve curve = FadeCurve.Smooth)

参数

名称类型默认值说明
音频AudioBuffer—The clip to fade.
时长数字0.5How long the fade takes, in seconds; a fade longer than the clip covers the whole clip.
曲线Fade Curve平滑The shape of the fade.

返回

音频AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

淡出

函数

Takes a clip down to silence at its end.

签名
淡出 -> AudioBuffer
    音频: AudioBuffer
    时长: 数字
    曲线: Fade Curve
AudioBuffer FadeOut(
    AudioBuffer audio,
    double duration = 0.5,
    FadeCurve curve = FadeCurve.Smooth)

参数

名称类型默认值说明
音频AudioBuffer—The clip to fade.
时长数字0.5How long the fade takes, in seconds; a fade longer than the clip covers the whole clip.
曲线Fade Curve平滑The shape of the fade.

返回

音频AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

增益

函数

Makes a clip louder or quieter by a number of decibels.

签名
增益(音频: AudioBuffer, 分贝: 数字) -> AudioBuffer
AudioBuffer Gain(AudioBuffer audio, double decibels = -6)

参数

名称类型默认值说明
音频AudioBuffer—The clip to change.
分贝数字-6How much louder (positive) or quieter (negative).

返回

音频AudioBuffer

备注

+6 dB roughly doubles the level and -6 dB roughly halves it; 0 dB leaves the clip exactly as it was. Anything pushed past full scale is clipped.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

混音

函数

Layers one clip over another, so both are heard at once.

签名
混音 -> AudioBuffer
    第一个: AudioBuffer
    第二个: AudioBuffer
    偏移: 数字
AudioBuffer Mix(
    AudioBuffer first,
    AudioBuffer second,
    double offset = 0)

参数

名称类型默认值说明
第一个AudioBuffer—The bottom layer; the result takes its sample rate.
第二个AudioBuffer—The layer on top.
偏移数字0How far into the first clip the second one starts, in seconds.

返回

音频AudioBuffer

备注

The result lasts until whichever clip ends later. The levels add, so lower them first if the sum would clip.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

全部混合

函数

Adds any number of clips together, all starting at the same moment.

签名
全部混合(片段: AudioBuffer 数组) -> AudioBuffer
AudioBuffer MixAll(AudioBuffer[] clips)

参数

名称类型默认值说明
片段AudioBuffer 数组—The clips; at least one.

返回

音频AudioBuffer

备注

The result is as long as the longest clip and has the most channels any clip has, at the first clip's sample rate. The levels add without being clipped, so the bands or parts a clip was divided into mix back to exactly that clip.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

标准化

函数

Turns a clip up or down so that its loudest moment reaches a set level.

签名
标准化(音频: AudioBuffer, 峰值分贝: 数字) -> AudioBuffer
AudioBuffer Normalize(
    AudioBuffer audio,
    double peakDecibels = -1)

参数

名称类型默认值说明
音频AudioBuffer—The clip to normalize.
峰值分贝数字-1The level the loudest sample should reach, in decibels below full scale; -1 leaves a little headroom.

返回

音频AudioBuffer

备注

A silent clip has no loudest moment and comes back unchanged.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

补白

函数

Adds silence before and after a clip.

签名
补白(音频: AudioBuffer, 之前: 数字, 之后: 数字) -> AudioBuffer
AudioBuffer Pad(
    AudioBuffer audio,
    double before = 0.5,
    double after = 0.5)

参数

名称类型默认值说明
音频AudioBuffer—The clip to pad.
之前数字0.5Silence to add at the start, in seconds.
之后数字0.5Silence to add at the end, in seconds.

返回

音频AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

重复

函数

Plays a clip several times in a row.

签名
重复(音频: AudioBuffer, 数量: 整数) -> AudioBuffer
AudioBuffer Repeat(AudioBuffer audio, int count = 2)

参数

名称类型默认值说明
音频AudioBuffer—The clip to repeat.
数量整数2How many times it plays in total.

返回

音频AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

倒放

函数

Plays a clip backwards.

签名
倒放(音频: AudioBuffer) -> AudioBuffer
AudioBuffer Reverse(AudioBuffer audio)

参数

名称类型默认值说明
音频AudioBuffer—The clip to reverse.

返回

音频AudioBuffer
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

相减

函数

Takes one clip away from another, sample by sample: what is in the first and not the second.

签名
相减(第一个: AudioBuffer, 第二个: AudioBuffer) -> AudioBuffer
AudioBuffer Subtract(AudioBuffer first, AudioBuffer second)

参数

名称类型默认值说明
第一个AudioBuffer—The clip taken from; the result takes its sample rate.
第二个AudioBuffer—The clip taken away.

返回

差值AudioBuffer

备注

Peak Decibels of the difference says how far apart two clips are - a clip and the parts it was divided into, mixed back, differ only by float rounding, well below -100 dB.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

裁剪

函数

Keeps one stretch of a clip and drops the rest.

签名
裁剪(音频: AudioBuffer, 起点: 数字, 长度: 数字) -> AudioBuffer
AudioBuffer Trim(
    AudioBuffer audio,
    double start = 0,
    double length = 1)

参数

名称类型默认值说明
音频AudioBuffer—The clip to cut.
起点数字0Where the kept stretch begins, in seconds from the start.
长度数字1How long the kept stretch is, in seconds.

返回

音频AudioBuffer

备注

A stretch that runs past the end of the clip stops at the end; one that starts past the end is empty.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理

去除静音

函数

Removes the quiet stretches at the start and the end of a clip.

签名
去除静音(音频: AudioBuffer, 阈值(分贝): 数字) -> AudioBuffer
AudioBuffer TrimSilence(
    AudioBuffer audio,
    double thresholdDecibels = -50)

参数

名称类型默认值说明
音频AudioBuffer—The clip to tidy.
阈值(分贝)数字-50How quiet counts as silence, in decibels below full scale.

返回

音频AudioBuffer

备注

A sample counts as quiet when every channel is below the threshold. A clip that is quiet throughout comes back empty.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
编辑
所属包
音频处理