Previous Topic Index Next Topic
[API function]

FSOUND_Sample_Load

Loads and decodes a static soundfile into memory.
This includes such files as .WAV, .MP2, .MP3, .OGG, .RAW and others.

FSOUND_SAMPLE * F_API FSOUND_Sample_Load(
int index,
const char *name,
unsigned int inputmode,
int memlength
);

Parameters

index Sample pool index. See remarks for more on the sample pool.
0 or above - The absolute index into the sample pool. The pool will grow as the
index gets larger. If a slot is already used it will be
replaced.
FSOUND_FREE - Let FSOUND select an arbitrary sample slot.
FSOUND_UNMANAGED - Dont have this sample managed within fsounds sample management system
name Name of sound file or pointer to memory image to load
mode Description of the data format, OR in the bits defined in FSOUND_MODES to
describe the data being loaded.
memlength If FSOUND_LOADMEMORY is specified as a mode, then this value must contain the length in BYTES of the
memory image being passed into the name field of the parameter list. Otherwise this value can be ignored
and set to zero (for example if you were loading a file from disk).
.

Return Value

On success, a sample pointer is returned.
On failure, NULL is returned.

Remarks

FMOD has a sample management system that holds onto any samples loaded or allocated, and
frees them all when you call FSOUND_Close. It takes the hassle out of having to keep hold
of a lot of sample handles and remember to free them all at the end of your application.
It is basically an expandle array of handles that holds each sample until FMOD closes down where it does
a cleanup. FSOUND_UNMANAGED can be used NOT to use the sample management system.
-----
Specify FSOUND_LOADMEMORY to load a file from a memory image. The pointer you pass to name must be the actual image of the data you want to load.
memlength is to be filled out if this flag is specified, otherwise it can be ignored and should be set to 0.
-----
Compressed formats are expanded into memory. If the file is quite large, it could take a while to load.
___________________
Supported on the following platforms : Win32, WinCE, Linux, Macintosh, XBox, PlayStation 2

See Also

FSOUND_Close , FSOUND_MODES , FSOUND_Sample_Alloc , FSOUND_Sample_Free

This document copyright ©Firelight Technologies, Pty, Ltd, 1999-2002. All rights reserved.
Generated Fri Dec 20 16:31:09 2002 by SourceDoc v0.10, the automated source code documenter.