MAKE MEMBLOCK FROM SOUND This command will make a memblock from a sound.
Syntax
    MAKE MEMBLOCK FROM SOUND Memblock Number, Sound Number
Parameters
    Memblock Number
Integer The memblock number
    Sound Number
Integer The sound number
Returns
This command does not return a value.
Description
The specified values must be integer values and the source resource must exist or the command will fail. The format for creating and gathering information on a sound is obtained in the following format. The offsets are specified in Bytes. Refer to the standard Windows SDK documentation on the WAVEFORMATEX data structure for the meanings of each field: OFFSET 0 - wFormatTag OFFSET 4 - nChannels OFFSET 8 - nSamplesPerSec OFFSET 12 - nAvgBytesPerSec OFFSET 16 - nBlockAlign OFFSET 20 - wBitsPerSample OFFSET 24 - cbSize
Example Code
    load sound "gun.wav",1

    MemblockNumber=1

    MAKE MEMBLOCK FROM SOUND MemblockNumber, 1

    delete sound 1

    MAKE SOUND FROM MEMBLOCK 1, MemblockNumber

    play sound 1

    rem Display data

    cls

    print "MEMBLOCK EXPRESSION DATA"

    print

    if MEMBLOCK EXIST(MemblockNumber)=1

    print "memblock:";MemblockNumber

    print "exist:";MEMBLOCK EXIST(MemblockNumber)

    print "ptr:";GET MEMBLOCK PTR(MemblockNumber)

    print "size:";GET MEMBLOCK SIZE(MemblockNumber)

    endif

    rem Delete memblocks

    if MEMBLOCK EXIST(MemblockNumber)=1 then DELETE MEMBLOCK MemblockNumber

    do

    loop

    end
See also
MEMBLOCKS Commands Menu Index