AudioClip

类位于 InfEngine.core

描述

音频剪辑资源。

description

构造函数

签名 描述
AudioClip.__init__(native: CppAudioClip) → None Wrap an existing C++ AudioClip.

constructors

属性

名称 类型 描述
native CppAudioClip The underlying C++ AudioClip object. (只读)
is_loaded bool Whether the audio data is loaded in memory. (只读)
duration float 时长(秒)。 (只读)
sample_count int Total number of audio samples. (只读)
sample_rate int 采样率。 (只读)
channels int 声道数。 (只读)
name str 剪辑名称。 (只读)
file_path str The file path the clip was loaded from. (只读)

properties

公共方法

方法 描述
unload() → None Unload the audio data from memory.

public_methods

静态方法

方法 描述
static AudioClip.load(file_path: str) → Optional[AudioClip] 从文件加载音频剪辑。
static AudioClip.from_native(native: CppAudioClip) → AudioClip Wrap an existing C++ AudioClip instance.

static_methods

运算符

方法 返回值
__repr__() → str str

operators

示例

# TODO: Add example for AudioClip

example

另请参阅

see_also