Play 2d sound effects||doc135615

September 20, 2022

Format

 TdAudioEngine:play2dSound(filePath, isLoop)

Description

Obtain the corresponding 2d sound effect file through the path to play and return the sound effect Id.


Parameters

Variable name type Description
filePath String file path
isLoop boolean whether to cycle


Value Returned

type Description
int sound effectId


Code Samples

  local soundID = TdAudioEngine.Instance():play2dSound("asset/Audio/Sound/click.mp3", true)
  print(soundID)