Loads a music from memory, resource pack or disk file.

HMUSIC Music_Load(
  const char *filename,
  DWORD size = 0


Music file name.
If this parameter isn't 0, it is the size of memory block containing the music in one of the known formats and the parameter filename is treated as a pointer to this block.

Return value

If successful, returns the music handle to be used with Music_Play function. Otherwise returns 0.


Supports MO3, IT, XM, S3M, MTM, MOD and UMX music file formats.

If filename specifies relative path, music file is first searched within all resource packs attached with Resource_AttachPack, then in the application disk folder. If filename specifies absolute disk path, music file is loaded directly from disk.

If the function fails, you may obtain error message with System_GetErrorMessage function. Also if HGE_LOGFILE system state was set, the error message is written to log.

When the music isn't needed longer, you must delete it with Music_Free function.


Header: hge.h
Import library: hge.lib

See also

Music_Free, Music_Play