sound||doc135327

September 20, 2022

TdAudioEngine

Introduction

The TdAudioEngine class is mainly used to play audio. When playing, it will return a soundID to manipulate the audio object.


Function

TdAudioEngine Instance (  )

Get an instance of TdAudioEngine

int play3dSound (  String filePath,  Vector3 pos,  boolean isLoop  )

Play 3d sound effects

int play2dSound (  String filePath,  boolean isLoop  )

Play 2d sound effects

void stopSound (  int nSoundId  )

stop sound

void setSoundsVolume (  int nSoundId,  float volume  )

Set the volume of the sound effect

void set3DMinMaxDistance (  int nSoundId,  float minDistance,  float maxDistance  )

Set the span between the maximum and minimum 3d sound effects

void set3DRollOffMode (  )

Set the decay mode for 3d sound effects

bool isPlaying (  int nSoundId  )

Determine whether to play

void pauseSound (  int nSoundId  )

Pause playback

void resumeSound (  int nSoundId  )

Resume sound playback

void allMute (  boolean isMute  )

Mute all

void setGlobalVolume (  float volume  )

set global volume

float getSoundsVolume (  int nSoundId  )

Get sound volume

void setSoundSpeed (  int nSoundId,  float percentage  )

Set sound playback speed

float getGlobalVolume (  )

get global volume