Method
Libopenmpt.ModuleReadMono(IntPtr, int, int, short[])

Summary

Syntax

[DllImport(DLL, EntryPoint = "openmpt_module_read_mono")]
public static extern int ModuleReadMono(IntPtr mod, int sampleRate, int count, short[] samples)

Remarks

The output buffers are only written to up to the returned number of elements.

You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.

It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.

Attributes

Type Description
DllImportAttribute

Parameters

Name Type Description
mod IntPtr The module handle to work on.
sampleRate int Sample rate to render output. Should be in [8000,192000], but this is not enforced.
count int Number of audio frames to render per channel.
samples short[] Pointer to a buffer of at least count elements that receives the mono/center output.

Return Value

Type Description
int The number of frames actually rendered. 0 if the end of song has been reached.