元編程參考文件

格式

8 個節點

本頁內容 8

改變速度

函數

Plays a clip faster or slower, the way a tape or a record does - pitch and tempo change together.

簽名
改變速度(音訊: AudioBuffer, 係數: 數字) -> AudioBuffer
AudioBuffer ChangeSpeed(AudioBuffer audio, double factor = 1.5)

參數

名稱型別預設值說明
音訊AudioBuffer—The clip to change.
係數數字1.5How much faster: above 1 speeds up, below 1 slows down.

返回

音訊AudioBuffer

備註

A factor of 2 is twice as fast and an octave higher; 0.5 is half speed and an octave lower.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
格式
所屬包
音訊處理

由樣本生成

函數

A one-channel clip made from an array of numbers from -1 to 1, one per sample.

簽名
由樣本生成(樣本: 數字陣列, 取樣率: 整數) -> AudioBuffer
AudioBuffer FromSamples(
    double[] samples,
    int sampleRate = 44100)

參數

名稱型別預設值說明
樣本數字陣列—The samples, in order.
取樣率整數44100How many of them make a second.

返回

音訊AudioBuffer

備註

Values beyond -1 and 1 are clipped when the clip is stored.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
格式
所屬包
音訊處理

聲像

函數

Places a clip between the left and right speakers.

簽名
聲像(音訊: AudioBuffer, 位置: 數字) -> AudioBuffer
AudioBuffer Pan(AudioBuffer audio, double position = 0)

參數

名稱型別預設值說明
音訊AudioBuffer—The clip to place.
位置數字0-1 is fully left, 0 the centre, 1 fully right.

返回

音訊AudioBuffer

備註

A mono clip is panned at constant power - at the centre each side is 3 dB down, so it sounds as loud wherever it is placed. A stereo clip is balanced instead: the side it moves away from is turned down and the near side is left alone, so at the centre it passes through unchanged.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
格式
所屬包
音訊處理

重取樣

函數

Converts a clip to another sample rate without changing how it sounds.

簽名
重取樣(音訊: AudioBuffer, 取樣率: 整數) -> AudioBuffer
AudioBuffer Resample(AudioBuffer audio, int sampleRate = 48000)

參數

名稱型別預設值說明
音訊AudioBuffer—The clip to convert.
取樣率整數48000The new number of samples per second.

返回

音訊AudioBuffer
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
格式
所屬包
音訊處理

轉為單聲道

函數

Mixes every channel of a clip down to one.

簽名
轉為單聲道(音訊: AudioBuffer) -> AudioBuffer
AudioBuffer ToMono(AudioBuffer audio)

參數

名稱型別預設值說明
音訊AudioBuffer—The clip to mix down.

返回

音訊AudioBuffer
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
格式
所屬包
音訊處理

轉為樣本

函數

One channel of a clip as an array of numbers from -1 to 1, one per sample - for arithmetic the toolbox has no node for.

簽名
轉為樣本(音訊: AudioBuffer, 聲道: 整數) -> 數字陣列
double[] ToSamples(AudioBuffer audio, int channel = 0)

參數

名稱型別預設值說明
音訊AudioBuffer—The clip to read.
聲道整數0Which channel, counting from 0; 0 is the left of a stereo clip.

返回

樣本數字陣列
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
格式
所屬包
音訊處理

轉為標準格式

函數

Converts a clip to the platform's standard 44.1 kHz stereo segment, which some other toolboxes ask for.

簽名
轉為標準格式(音訊: AudioBuffer) -> StandardAudioSegment
StandardAudioSegment ToStandard(AudioBuffer audio)

參數

名稱型別預設值說明
音訊AudioBuffer—The clip to convert.

返回

音訊StandardAudioSegment
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
格式
所屬包
音訊處理

轉為立體聲

函數

Gives a clip two channels: a mono clip is heard equally on both sides, and a clip with more than two keeps its first two.

簽名
轉為立體聲(音訊: AudioBuffer) -> AudioBuffer
AudioBuffer ToStereo(AudioBuffer audio)

參數

名稱型別預設值說明
音訊AudioBuffer—The clip to convert.

返回

音訊AudioBuffer
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
格式
所屬包
音訊處理