# PlaySound

## Description

Play the sound previously loaded into the specified sound number. This command can be called multiple times for the same sound ID and it will start multiple copies of that sound playing as instances. The command will return an instance ID that can be used to interact with this instance whilst it is still playing. When an instance stops playing then it is automatically deleted and can no longer be referenced. By default the sound is not looped.

## Definition

integer PlaySound( iID, iVol )

UINT agk::PlaySound( UINT iID, int iVol )

integer PlaySound( iID, iVol, iLoop )

UINT agk::PlaySound( UINT iID, int iVol, int iLoop )

integer PlaySound( iID, iVol, iLoop, iPriority )

UINT agk::PlaySound( UINT iID, int iVol, int iLoop, int iPriority )

integer PlaySound( iID )

UINT agk::PlaySound( UINT iID )

## Parameters

- iID - The sound number to play.
- iVol - The volume at which the sound should be played (optional, default 100).
- iLoop - The number of times to loop the instance, or 1 for forever.
- iPriority - Reserved for future use, must be 0 (optional, default 0).