Method
Libopenmpt.ModuleReadFloatMono(IntPtr, int, int, float[])

Summary

Syntax

[DllImport(DLL, EntryPoint = "openmpt_module_read_float_mono")]
public static extern int ModuleReadFloatMono(IntPtr mod, int sampleRate, int count, float[] 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.

Floating point samples are in the [-1.0..1.0] nominal range. They are not clipped to that range though and thus might overshoot.

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 float[] 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.