Pub.ufmod:FunctionsModinfo 

μFMOD (WINMM/OSS)

A tiny XM player module. File and direct memory playback supported in both Windows and Unix/Linux. Windows module allows resource playback as well. Output sound using WINMM in Windows and OSS in Unix/Linux. Check Pub.dsufmod for a DirectX DirectSound uFMOD module for Windows.

Functions

Function uFMOD_PlayFile(filename:String,dwReserved,dwFlags)
ReturnsOn success, returns a pointer to an open output device handle. Returns zero on failure.
DescriptionStarts playing the given XM file.
Parameters filename
A string that specifies the name of the file.
 
dwReserved
Reserved for possible future use; should be zero.
 
dwFlags
Additional flags, controlling the playback. The following values are defined:
XM_NOLOOP    An XM track plays repeatedly by default. Specify
             this flag to play it only once.
XM_SUSPENDED The XM track is loaded in a suspended state,
             and will not play until the uFMOD_Resume function
             is called. This is useful for preloading a song
             or testing an XM track for validity.
Set to zero, if not using any special flags.
Example
If uFMOD_PlayFile("mini.xm",0,0)
	WriteStdout "Playing song... [Press Enter to quit]"
	ReadStdin()
	uFMOD_Stop
Else
	WriteStdout "Error!"
EndIf

Function uFMOD_PlayMem(pXM:Byte Ptr,length,dwFlags)
ReturnsOn success, returns a pointer to an open output device handle. Returns zero on failure.
DescriptionStarts playing an XM track from memory. Once, uFMOD_PlayMem returns, it's safe to free/discard the memory buffer.
Parameters pXM
Points to an image of a song in memory.
 
length
Size of the image in bytes.
 
dwFlags
Additional flags, controlling the playback. The following values are defined:
XM_NOLOOP    An XM track plays repeatedly by default. Specify
             this flag to play it only once.
XM_SUSPENDED The XM track is loaded in a suspended state,
             and will not play until the uFMOD_Resume function
             is called. This is useful for preloading a song
             or testing an XM track for validity.
Set to zero, if not using any special flags.
Example
Incbin "mini.xm"

If uFMOD_PlayMem(IncbinPtr "mini.xm",IncbinLen "mini.xm",0)
	WriteStdout "Playing song... [Press Enter to quit]"
	ReadStdin()
	uFMOD_Stop
Else
	WriteStdout "Error!"
EndIf

Function uFMOD_PlayRes(dwName,hModule,dwFlags)
ReturnsOn success, returns a pointer to an open output device handle. Returns zero on failure.
DescriptionStarts playing an XM track from a resource image. The resource type must be RCDATA.
Parameters dwName
Specifies the ID of the XM resource. You can change this function's prototype to accept an ASCII null-terminated string, specifying the name of the resource.
 
hModule
Identifies the module whose executable file contains the resource. Could be zero if the given resource is located in the current module.
 
dwFlags
Additional flags, controlling the playback. The following values are defined:
XM_NOLOOP    An XM track plays repeatedly by default. Specify
             this flag to play it only once.
XM_SUSPENDED The XM track is loaded in a suspended state,
             and will not play until the uFMOD_Resume function
             is called. This is useful for preloading a song
             or testing an XM track for validity.
Set to zero, if not using any special flags.

Function uFMOD_Stop()
DescriptionStops the currently playing song, if any.

Function uFMOD_Pause()
DescriptionPauses the currently playing song, if any.

Function uFMOD_Resume()
DescriptionResumes the currently paused song, if any.

Function uFMOD_GetStats()
Returns
low-order word : RMS volume in R channel
hi-order  word : RMS volume in L channel
DescriptionReturns the current RMS volume coefficients in L and R channels.

Function uFMOD_GetTime()
DescriptionReturns the time in milliseconds since the song was started. This is useful for synchronizing purposes.

Function uFMOD_GetTitle$()
DescriptionReturns the current track's title, if any.

Function uFMOD_SetVolume(vol)
DescriptionSets the global volume. The volume scale is linear. Maximum volume is set by default.
Parameters vol
New volume. Range: from 0 (muting) to 64 (maximum volume). Any value above 64 maps to maximum volume too.

Module Information

Version1.20
CopyrightAsterix and Quantum