跳至主要內容

Class: audio

muzzik大约 2 分钟

index / audio

Class: audio

音频基类

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new audio()

Overrides

instance_base.constructor

Defined in

assets/@framework/audio/mk_audio_base.ts:18open in new window

Properties

_log

Protected Abstract _log: logger

日志

Defined in

assets/@framework/audio/mk_audio_base.ts:25open in new window


_group_map

Protected _group_map: Map<number, group>

音频组

Defined in

assets/@framework/audio/mk_audio_base.ts:27open in new window

Methods

pause

Abstract pause(audio_): void

暂停

Parameters

NameType
audio_unit

Returns

void

Defined in

assets/@framework/audio/mk_audio_base.ts:30open in new window


stop

Abstract stop(audio_): void

停止

Parameters

NameType
audio_unit

Returns

void

Defined in

assets/@framework/audio/mk_audio_base.ts:32open in new window


_get_audio_unit

Protected Abstract _get_audio_unit<T>(init_?): T

获取音频实例

Type parameters

NameType
Textends _unit

Parameters

NameType
init_?Partial<_unit>

Returns

T

Defined in

assets/@framework/audio/mk_audio_base.ts:34open in new window


get_group

get_group(group_n_): group

获取音频组

Parameters

NameTypeDescription
group_n_number组类型

Returns

group

Defined in

assets/@framework/audio/mk_audio_base.ts:41open in new window


add

add(url_s_, target_, config_?): Promise<null | unit & unit[]>

添加音频单元

Parameters

NameTypeDescription
url_s_string音频资源路径
target_follow_release_object跟随释放对象
config_?add_config添加配置

Returns

Promise<null | unit & unit[]>

Defined in

assets/@framework/audio/mk_audio_base.ts:57open in new window

add(url_ss_, target_, config_?): Promise<null | unit[]>

添加音频单元

Parameters

NameTypeDescription
url_ss_string[]音频资源路径列表
target_follow_release_object跟随释放对象
config_?add_config添加配置

Returns

Promise<null | unit[]>

Defined in

assets/@framework/audio/mk_audio_base.ts:68open in new window


play

play(audio_, config_?): boolean

播放音效

Parameters

NameTypeDescription
audio_unit音频单元
config_?Partial<play_config>播放配置

Returns

boolean

Defined in

assets/@framework/audio/mk_audio_base.ts:139open in new window


pause_all

pause_all(): void

暂停所有音频

Returns

void

Defined in

assets/@framework/audio/mk_audio_base.ts:166open in new window


resume_all

resume_all(): void

恢复所有音频

Returns

void

Defined in

assets/@framework/audio/mk_audio_base.ts:175open in new window


stop_all

stop_all(): void

停止所有音频

Returns

void

Defined in

assets/@framework/audio/mk_audio_base.ts:186open in new window

📣 觉得很赞?分享给你的朋友吧!