Pub.dsufmod:FunctionsModinfo 

μFMOD (DirectX DirectSound)

A tiny XM player module. File, resource and direct memory playback supported. Output sound using DirectX DirectSound. Check Pub.ufmod for a WINMM/OSS uFMOD module for Windows/Linux.

Functions

Function uFMOD_DSPlayFile(filename:String,dwReserved,dwFlags,pDSBuffer:IDirectSoundBuffer)
ReturnsReturns DS_OK on success or an error value otherwise:
 DSERR_BUFFERLOST
 DSERR_INVALIDCALL
 DSERR_INVALIDPARAM
 DSERR_PRIOLEVELNEEDED
DescriptionStarts playing the given XM file. Once playback has started, it's not necessary to check for "buffer lost" condition, since uFMOD performs buffer restoring automatically.
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_DSResume 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.
 
pDSBuffer
A pointer to an IDirectSoundBuffer. uFMOD assumes that it has been properly initialized to 16-bit stereo. There's an example in directx\mini_ds.bmx.

Function uFMOD_DSPlayMem(pXM:Byte Ptr,length,dwFlags,pDSBuffer:IDirectSoundBuffer)
ReturnsReturns DS_OK on success or an error value otherwise:
 DSERR_BUFFERLOST
 DSERR_INVALIDCALL
 DSERR_INVALIDPARAM
 DSERR_PRIOLEVELNEEDED
DescriptionStarts playing an XM track from memory. Once, uFMOD_DSPlayMem returns, it's safe to free/discard the memory buffer; and it's not necessary to check for "buffer lost" condition, since uFMOD performs buffer restoring automatically.
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_DSResume 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.
 
pDSBuffer
A pointer to an IDirectSoundBuffer. uFMOD assumes that it has been properly initialized to 16-bit stereo. There's an example in directx\mini_ds.bmx.

Function uFMOD_DSPlayRes(dwName,hModule,dwFlags,pDSBuffer:IDirectSoundBuffer)
ReturnsReturns DS_OK on success or an error value otherwise:
 DSERR_BUFFERLOST
 DSERR_INVALIDCALL
 DSERR_INVALIDPARAM
 DSERR_PRIOLEVELNEEDED
DescriptionStarts playing an XM track from a resource image. The resource type must be RCDATA. Once playback has started, it's not necessary to check for "buffer lost" condition, since uFMOD performs buffer restoring automatically.
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_DSResume 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.
 
pDSBuffer
A pointer to an IDirectSoundBuffer. uFMOD assumes that it has been properly initialized to 16-bit stereo. There's an example in directx\mini_ds.bmx.

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

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

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

Function uFMOD_DSGetStats()
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_DSGetTime()
DescriptionReturns the time in milliseconds since the song was started. This is useful for synchronizing purposes.

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

Function uFMOD_DSSetVolume(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