1load_sample(3)                  Allegro manual                  load_sample(3)
2
3
4

NAME

6       load_sample  -  Loads  a  sample  from a file. Allegro game programming
7       library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       SAMPLE *load_sample(const char *filename);
14

DESCRIPTION

16       Loads a sample from a file, supporting both mono  and  stereo  WAV  and
17       mono  VOC  files, in 8 or 16-bit formats, as well as formats handled by
18       functions registered using register_sample_file_type(). Example:
19
20          SAMPLE *sample = load_sample(user_input);
21          if (!sample)
22             abort_on_error("Couldn't load sample!");
23

RETURN VALUE

25       Returns a pointer to the SAMPLE or NULL on error. Remember to free this
26       sample later to avoid memory leaks.
27
28

SEE ALSO

30       destroy_sample(3),  load_voc(3), load_wav(3), play_sample(3), save_sam‐
31       ple(3), register_sample_file_type(3), exsample(3)
32
33
34
35Allegro                          version 4.4.2                  load_sample(3)
Impressum