元編程參考文件

檔案

6 個節點

本頁內容 6

載入音訊

函數

Opens an audio file - WAV, MP3, M4A/AAC, FLAC, Ogg Vorbis or Ogg Opus - at its own sample rate and channel count.

簽名
載入音訊(路徑: 文字) -> AudioBuffer
AudioBuffer LoadAudio(string path)

參數

名稱型別預設值說明
路徑文字—The file to open.

返回

音訊AudioBuffer

備註

The format is read from the file's first bytes, not its name, so a mislabelled file still opens.

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

載入音訊位元組

函數

Decodes an audio file that is already in memory - an asset, a download, an attachment.

簽名
載入音訊位元組(位元組: 位元組陣列) -> AudioBuffer
AudioBuffer LoadAudioBytes(byte[] bytes)

參數

名稱型別預設值說明
位元組位元組陣列—The whole file, as it would be on disk.

返回

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

儲存為 FLAC

函數

Saves a clip as a FLAC file - lossless, and usually about half the size of the WAV.

簽名
儲存為 FLAC(音訊: AudioBuffer, 路徑: 文字) -> 文字
string SaveFlac(AudioBuffer audio, string path)

參數

名稱型別預設值說明
音訊AudioBuffer—The clip to save.
路徑文字—Where to write it; a .flac name is conventional.

返回

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

儲存為 WAV

函數

Saves a clip as a 16-bit WAV file, creating the folder if it is not there.

簽名
儲存為 WAV(音訊: AudioBuffer, 路徑: 文字) -> 文字
string SaveWav(AudioBuffer audio, string path)

參數

名稱型別預設值說明
音訊AudioBuffer—The clip to save.
路徑文字—Where to write it; a .wav name is conventional.

返回

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

支援的副檔名

函數

The file extensions AudioFiles.LoadAudio can open.

簽名
支援的副檔名() -> 文字陣列
string[] SupportedExtensions()

返回

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

轉為 WAV 位元組

函數

A clip as the bytes of a 16-bit WAV file, without touching the disk - for sending, embedding or serving.

簽名
轉為 WAV 位元組(音訊: AudioBuffer) -> 位元組陣列
byte[] ToWavBytes(AudioBuffer audio)

參數

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

返回

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