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
LastPlayedTrack
The track that played before
IMusicTrack LastPlayedTrack { get; }
Property Value
MillisecondsSinceLastTrack
The total passed milliseconds since game start at the point where the last track stopped playing
long MillisecondsSinceLastTrack { get; }
Property Value
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
AssetLocationonLoaded
Action<ILoadedSound>volume
floatpitch
float
StopTrack(IMusicTrack)
void StopTrack(IMusicTrack musicTrack)
Parameters
musicTrack
IMusicTrack