Class: audio
index / audio
Class: audio
音频基类
Hierarchy
↳
audio
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new audio()
Overrides
Defined in
assets/@framework/audio/mk_audio_base.ts:18
Properties
_log
• Protected
Abstract
_log: logger
日志
Defined in
assets/@framework/audio/mk_audio_base.ts:25
_group_map
• Protected
_group_map: Map
<number
, group
>
音频组
Defined in
assets/@framework/audio/mk_audio_base.ts:27
Methods
pause
▸ Abstract
pause(audio_
): void
暂停
Parameters
Name | Type |
---|---|
audio_ | unit |
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:30
stop
▸ Abstract
stop(audio_
): void
停止
Parameters
Name | Type |
---|---|
audio_ | unit |
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:32
_get_audio_unit
▸ Protected
Abstract
_get_audio_unit<T
>(init_?
): T
获取音频实例
Type parameters
Name | Type |
---|---|
T | extends _unit |
Parameters
Name | Type |
---|---|
init_? | Partial <_unit > |
Returns
T
Defined in
assets/@framework/audio/mk_audio_base.ts:34
get_group
▸ get_group(group_n_
): group
获取音频组
Parameters
Name | Type | Description |
---|---|---|
group_n_ | number | 组类型 |
Returns
Defined in
assets/@framework/audio/mk_audio_base.ts:41
add
▸ add(url_s_
, target_
, config_?
): Promise
<null
| unit
& unit
[]>
添加音频单元
Parameters
Name | Type | Description |
---|---|---|
url_s_ | string | 音频资源路径 |
target_ | follow_release_object | 跟随释放对象 |
config_? | add_config | 添加配置 |
Returns
Defined in
assets/@framework/audio/mk_audio_base.ts:57
▸ add(url_ss_
, target_
, config_?
): Promise
<null
| unit
[]>
添加音频单元
Parameters
Name | Type | Description |
---|---|---|
url_ss_ | string [] | 音频资源路径列表 |
target_ | follow_release_object | 跟随释放对象 |
config_? | add_config | 添加配置 |
Returns
Promise
<null
| unit
[]>
Defined in
assets/@framework/audio/mk_audio_base.ts:68
play
▸ play(audio_
, config_?
): boolean
播放音效
Parameters
Name | Type | Description |
---|---|---|
audio_ | unit | 音频单元 |
config_? | Partial <play_config > | 播放配置 |
Returns
boolean
Defined in
assets/@framework/audio/mk_audio_base.ts:139
pause_all
▸ pause_all(): void
暂停所有音频
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:166
resume_all
▸ resume_all(): void
恢复所有音频
Returns
void
Defined in
assets/@framework/audio/mk_audio_base.ts:175
stop_all
▸ stop_all(): void
停止所有音频
Returns
void