minetest.sound play

Description
Plays a sound.

Only Ogg Vorbis files are supported. For positional playing of sounds, only single-channel (mono) files are supported. Otherwise OpenAL will play them non-positionally.

can be a string with the filename (without the file extention) or a table with the fields  and.

is a table with the following fields:
 * : the gain. default = 1.0
 * : the maximum hear distance. default = 32
 * : Sound is looped. Only sounds connected to objects can be looped. default = false

The location can be specified with one of the following fields in the SoundParameters (if none is used, its played locationless to all players):
 * : Sound is played locationless to the player
 * : Sound is played at this position
 * : Sound is played connected to the object

The function returns a sound handle that can be passed to  to stop the sound.

Features
You can play random sound using filename convention  (see examples)

Examples
Plays the  sound at the position 0,0,0.

Plays the  sound to player "foo".

Plays random  sound.