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) → integerParameters
| Name | Type | In forms |
|---|---|---|
| memID | integer | 1 |
| soundID | integer | all |
What each form returns
| 1 | CreateMemblockFromSound(1, sound) | nothing |
| 2 | memblockFromSound = CreateMemblockFromSound(1) | integer |
Example · generated
Form 1, you choose the id yourself
sound = LoadSound("assets/sound.wav")CreateMemblockFromSound(1, sound)DO Sync()LOOPForm 2, the command hands back the id
memblockFromSound = CreateMemblockFromSound(1)DO Sync()LOOPLoadSound 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.