ad_play

From ArchaicPixels: HuC and PCEAS Documentation

Jump to: navigation, search

ad_play(int ad_addr, int bytes, char freq, char mode);    [ 3.21+ ]

Plays adpcm sound from data loaded in the ADPCM buffer.

  ad_addr - address of the ADPCM data buffer
  bytes - number of bytes to play
  freq - playback frequency
  mode - single play, or loop mode

Start playing from 'ad_addr' offset in the adpcm buffer, for 'bytes' bytes. The frequency used for playback is computed from 'freq' using the following formula:

   real_frequency_in_khz = 32 / (16 - 'freq'). 

Valid range for 'freq' is 0-15.

If bit 0 of 'mode' is on, values of 'ad_addr', 'bytes' and 'freq' from the previous ad_play call are reused. If bit 7 of 'mode' is on, playback loops instead of stopping at the end of the range.

Personal tools