Table of Contents

Interface IMusicEngine

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll
public interface IMusicEngine
Extension Methods

Properties

CurrentTrack

The currently playing track

IMusicTrack CurrentTrack { get; }

Property Value

IMusicTrack

LastPlayedTrack

The track that played before

IMusicTrack LastPlayedTrack { get; }

Property Value

IMusicTrack

MillisecondsSinceLastTrack

The total passed milliseconds since game start at the point where the last track stopped playing

long MillisecondsSinceLastTrack { get; }

Property Value

long

Methods

LoadTrack(AssetLocation, Action<ILoadedSound>, float, float)

Loads the sound into memory and plays the track. Slow call. Encapsulate it into ThreadPool.QueueUserWorkItem() to not block the main thread

void LoadTrack(AssetLocation location, Action<ILoadedSound> onLoaded, float volume = 1, float pitch = 1)

Parameters

location AssetLocation
onLoaded Action<ILoadedSound>
volume float
pitch float

StopTrack(IMusicTrack)

void StopTrack(IMusicTrack musicTrack)

Parameters

musicTrack IMusicTrack