GNU Info

Info Node: (mikmod.info)Sample Functions

(mikmod.info)Sample Functions


Next: Voice Functions Prev: Module Player Functions Up: Function Reference
Enter node , (file) or (file)node

Sample Functions
----------------

Sample_Free
...........

   `void Sample_Free(SAMPLE* sample)'
Description
     This function unloads a sample from memory.

Parameters
sample
     The sample to free.

See also
     `Sample_Load', `Sample_LoadFP'.

Sample_Load
...........

   `SAMPLE* Sample_Load(CHAR* filename)'
Description
     This function loads a sample.

Parameters
filename
     The sample filename.

Result
     A pointer to a `SAMPLE' structure, or `NULL' if an error has
     occurred.

See also
     `Sample_Free', `Sample_LoadFP'.

Sample_LoadFP
.............

   `SAMPLE* Sample_LoadFP(FILE* file)'
Description
     This function loads a sample.

Parameters
file
     An open file, at the position where the sample starts.

Result
     A pointer to a `SAMPLE' structure, or `NULL' if an error has
     occurred.

Notes
     The file is left open, at the same position as before the function
     call.

See also
     `Sample_Free', `Sample_Load'.

Sample_Play
...........

   `SBYTE Sample_Play(SAMPLE* sample, ULONG start, UBYTE flags)'
Description
     This function plays a sample as a sound effect.

Parameters
sample
     The sample to play.

start
     The starting position (in samples).

flags
     Either zero, for normal sound effects, or `SFX_CRITICAL', for
     critical sound effects which must not be interrupted.

Result
     The voice number corresponding to the voice which will play the
     sample.

Notes
     Each new sound effect is played on a new voice. When all voices
     are taken, the oldest sample which was not marked as critical is
     cut and its voice is used for the new sample. Critical samples are
     not cut unless all the voices are taken with critical samples and
     you attempt to play yet another critical sample. Use `Voice_Stop'
     to force the end of a critical sample.

See also
     `MikMod_SetNumVoices', `Voice_Play', `Voice_SetFrequency',
     `Voice_SetPanning', `Voice_SetVolume', `Voice_Stop'.


automatically generated by info2www version 1.2.2.9