DS
mm_ds_sample

Back to Index

Definition

typedef struct t_mmdssample
{
    mm_word loop_start;
    union {
        mm_word loop_length;
        mm_word length;
    };
    mm_byte format;
    mm_byte repeat_mode;
    mm_hword base_rate;
    mm_addr data;
} mm_ds_sample;

Members

loop_start

Start of sample loop. Measured in words.

loop_length

Length of sample loop. Measured in words.

length

Length of sample. Measured in words.

format

Sample format. 0 = 8-bit PCM, 1 = 16-bit PCM, 2 = IMA-ADPCM

repeat_mode

Looping mode. 1 = Forward Loop, 2 = One-Shot

base_rate

Center playback rate. Value = Hz * 1024 / 32768.

data

Pointer to sample data.

Description

Sample structure.

If the sample loops, then loop_start should be set to the position of the loop starting point, and loop_length should be set to the length of the loop. Otherwise, loop_start should be set to zero, and length should be set to the length of the sample.

The length and position values are measured in words. That is, samples/4 for 8-bit, and samples/2 for 16-bit (and samples/8 for 4-bit compressed). The sample data must be aligned and maybe resampled or padded to fit along the boundaries.

See Also

mmEffectExt