Item LoadSampleHere( char *Name, void*(*CustomAllocMem)(),void (*CustomFreeMem)() )
LoadSample()
, loads and creates a sample item in RAM from a sample stored in the specified file. The major difference is that LoadSampleHere()
allows a task to use its own memory allocation and deallocation calls to provide RAM for the sample.
To use this task, you must provide a custom allocation function and a custom deallocation function and then specify them in the call. When LoadSampleHere()
executes, it passes these arguments to the allocation function:
( int32 NumBytes, uint32 MemType )
The allocation call should return a DataPtr to the allocated memory if successful or NULL if unsuccessful.
When the sample is later unloaded using UnloadSample()
, the deallocation function receives these arguments:
( void *DataPtr, int32 NumBytes)
The deallocation function must use these arguments to free the sample's memory.
CustomAllocMem()
CustomFreeMem()
AttachSample
(), DetachSample(), SetAudioItemInfo(), UnloadSample(), DebugSample(), CreateSample(), ScanSample(), GetAudioItemInfo(), LoadSample()