Avorion Script API Documentation

SoundSource

Sound sources are sound emitters. These objects are meant for long, looping and constant sounds. If you want to play a quick sound (and only once) use the playSound() function. You have to keep this object around in your script. Once the object gets destroyed by the lua garbage collector, the sound will stop playing. If you want to destroy the object actively and free the sound resource, use its terminate() function.

This object is only available on the client.

function SoundSource(string soundName, var position, var radius)

Creates a new sound source.

Returns

A new instance of SoundSource

property bool is3D[read-only]
property bool loop
property float maxRadius
property float minRadius
property bool playing[read-only]
property vec3 position
property float volume

function var play()

Returns

nothing

function var stop()

Returns

nothing

function var terminate()

Stops the sound and frees all resources connected to it. The SoundSource object will be inaccessible after this function.

Returns

nothing

Overview
Home Functions Search
Search:

This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.

Work in Progress. Documentation of Avorion Version: 2.5.7 c8e4beec84f7