Play 3d sound effects||doc135612

September 20, 2022

Format

 TdAudioEngine:play3dSound(filePath, pos, isLoop)

Description

Obtain the corresponding 3D sound effect file through the path and start playing at the specified coordinates and return the sound effect Id.


Parameters

Variable name type Description
filePath String file path
pos Vector3 Play position
isLoop boolean whether to cycle


Value Returned

type Description
int sound effectId


Code Samples

local soundID = TdAudioEngine.Instance():play3dSound("asset/Audio/Sound/click.mp3",{x = 0,y = 3,z = 0} ,true)
print(soundID)