[Image]  APEX AUDIO SYSTEM
Instruction Manual

intro | getting started | conv2aas | example | faq
api : index | general | sfx | mod | misc | mixer


:: How do I reference AAS sounds with numbers?

All the sounds in your project are given a unique variable name based on their filename in the header file (AAS_Data.h) generated by Conv2AAS. In some cases you may want to use a number to refer to the data instead. To do this, create a const array that is pre-defined to list all the sounds in your project and use the array in your code instead. For example, with samples called "mysample1.wav" and "mysample2.wav":

struct AAS_Samp
{
  const AAS_s8* const start;
  const AAS_s8* const end;
};

const struct AAS_Samp AAS_samples[] =
{
  { AAS_DATA_SFX_START_mysample1, AAS_DATA_SFX_END_mysample1 },
  { AAS_DATA_SFX_START_mysample2, AAS_DATA_SFX_END_mysample2 }
};

These samples can then be referred to using numbers as follows:

AAS_SFX_Play( 0, 64, 16000, AAS_samples[0].start, AAS_samples[0].end, AAS_NULL );

This code could easily be extended to also store loop, volume and frequency data as well.