Class
Module

Summary

Syntax

public class Module : IDisposable

Properties

Name Property Type Summary
Pointer IntPtr
The pointer representation that can be used with the Libopenmpt static class.

Methods

Name Return Value Summary
~Module() void
Create(byte[], Module) bool
Creates a new Unitune Module instance from the provided byte array of module data.
static
CreateAudioClip(ChannelCount, int, float, float) AudioClip
Creates an AudioClip from the module's audio data with the specified settings.
CreateAudioClipStream(AudioClip.PCMReaderCallback, AudioClip.PCMSetPositionCallback, ChannelCount, int, float, float) AudioClip
Creates a streaming AudioClip with the provided PCM reader and position callback functions. Please note that this method is not available on WebGL and will fall back to CreateAudioClip instead.
CreateAudioClipStream(ChannelCount, int, float, float) AudioClip
Creates a streaming AudioClip from the module's audio data with the specified settings. Suitable for large files. Please note that this method is not available on WebGL and will fall back to CreateAudioClip instead.
Dispose() void
Releases the unmanaged resources used by the module.
GetCurrentSubsongIndex() int
Gets the index of the currently selected subsong.
GetDuration() float
Gets the duration of the module in seconds.
GetFrameCount(int, float) int
Gets the number of frames based on the specified duration at the given sample rate.
static
GetFrameCount(int) int
Gets the number of frames based on the duration of the selected subsong and at the given sample rate.
GetMetadata() string[]
Retrieves all metadata from the module.
GetMetadata(ModuleMetadataType) string
Retrieves metadata from the module based on the specified ModuleMetadataType.
GetRenderParameter(RenderParamIndices, int) bool
Get render parameter.
GetSampleCount(int, ChannelCount) int
Gets the number of samples based on the duration of the selected subsong, the given channel count and sample rate.
GetSampleCount(int, float, ChannelCount) int
Gets the number of samples based on the specified duration at the given sample rate and channel count.
static
GetSubsongCount() int
Gets the number of subsongs in the module.
GetSubsongName(int) string
Gets the name of the subsong at the specified index.
IsChannelCountValid(ChannelCount) bool
Determines if the specified channel count is valid.
static
SelectSubsong(int) bool
Selects the subsong at the specified index for playback.
SetContinueAtEnd() void
Set the behavior when the end of the song is reached to continue from the loop start. If the song is not programmed to loop, playback resumed from the song start.
SetFadeOutAtEnd() void
Set the behavior when the end of the song is reached to fade out for a short while. This is the default behavior.
SetNormalizedTime(float, float, float) void
Set the playback position of the module based on a normalized time, starting from a normalized time of the full duration and within a normalized duration. That normalized duration corresponds to a portion of the full song.
SetNormalizedTime(float) void
Sets the playback position of the module based on a normalized time value.
SetPosition(int, int, float, float) void
Sets the frame position of the module based on various settings.
SetPosition(int, int) void
Sets the frame position of the module based on the sample rate.
SetRenderParameter(RenderParamIndices, int) bool
Set render parameter.
SetSamples(float[], ChannelCount, int) int
Sets the audio samples into the specified frame buffer with the given channel count and sample rate.
SetStopAtEnd() void
Set the behavior when the end of the song is reached to stop abruptly.
SetTime(float) void
Sets the playback position of the module based on a time value in seconds.