文件
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. |
返回
| 字节 | 字节数组 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 文件
- 所属包
- 音频处理