CreateMemblockFromSound

Family: Memblock · 2 forms

What it does

CreateMemblockFromSound creates FromSound on a Memblock object. It takes memID (an integer) and soundID (an integer), and returns nothing. That is the first of 2 forms. memID is the id you are giving a memblock: every later call names it by that number.

Syntax

1
CreateMemblockFromSound(memID integer, soundID integer)
2
CreateMemblockFromSound(soundID integer) → integer

Parameters

NameTypeIn forms
memIDinteger1
soundIDintegerall

What each form returns

1CreateMemblockFromSound(1, sound)nothing
2memblockFromSound = CreateMemblockFromSound(1)integer

Example · generated

Form 1, you choose the id yourself

sound = LoadSound("assets/sound.wav")CreateMemblockFromSound(1, sound)DO  Sync()LOOP

Form 2, the command hands back the id

memblockFromSound = CreateMemblockFromSound(1)DO  Sync()LOOP

LoadSound is there to give the call something to act on; CreateMemblockFromSound is the line that matters. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

43 commands in Memblock