m4m.framework.AudioPlayer

@meta4d/engine / Exports / m4m / framework / AudioPlayer

Class: AudioPlayer

m4m.framework.AudioPlayer

Implements

Table of contents

Properties

Methods

Constructors

Accessors

Properties

be3DSound

be3DSound: boolean = true

Defined in

framework/component/audioplayer.ts:12


beLoop

beLoop: boolean

Defined in

framework/component/audioplayer.ts:11


buffer

buffer: AudioBuffer

Defined in

framework/component/audioplayer.ts:10


gameObject

gameObject: gameObject

Implementation of

INodeComponent.gameObject

Defined in

framework/component/audioplayer.ts:14


ClassName

Static Readonly ClassName: string = "AudioPlayer"

Defined in

framework/component/audioplayer.ts:8

Methods

clone

clone(): void

Returns

void

Implementation of

INodeComponent.clone

Defined in

framework/component/audioplayer.ts:145


isPlaying

isPlaying(): boolean

language zh_CN

classdesc 获得当前音频播放器是否在播放

version m4m 1.0

Returns

boolean

Defined in

framework/component/audioplayer.ts:112


onPlay

onPlay(): void

Returns

void

Implementation of

INodeComponent.onPlay

Defined in

framework/component/audioplayer.ts:121


play

play(buffer, beLoop?, volume?, onended?): void

language zh_CN

classdesc 播放声音

Parameters

Name
Type
Default value
Description

buffer

AudioBuffer

undefined

音源缓冲对象

beLoop

boolean

false

是循环播放

volume

number

0

音量 0-1

onended?

Function

undefined

音源播放结束回调

Returns

void

Defined in

framework/component/audioplayer.ts:26


remove

remove(): void

Returns

void

Implementation of

INodeComponent.remove

Defined in

framework/component/audioplayer.ts:141


start

start(): void

Returns

void

Implementation of

INodeComponent.start

Defined in

framework/component/audioplayer.ts:116


stop

stop(): void

language zh_CN

classdesc 停止播放

version m4m 1.0

Returns

void

Defined in

framework/component/audioplayer.ts:74


update

update(delta): void

Parameters

Name
Type

delta

number

Returns

void

Implementation of

INodeComponent.update

Defined in

framework/component/audioplayer.ts:130

Constructors

constructor

new AudioPlayer()

Accessors

volume

get volume(): number

language zh_CN

classdesc 获取音量大小

version m4m 1.0

Returns

number

Defined in

framework/component/audioplayer.ts:88

set volume(val): void

language zh_CN

classdesc 设置音量大小

version m4m 1.0

Parameters

Name
Type

val

number

Returns

void

Defined in

framework/component/audioplayer.ts:100

Last updated