1 #include <stdio.h>
2 #include "logg.h"
3
main(int argc,char ** argv)4 int main(int argc, char** argv)
5 {
6 SAMPLE* s;
7 int voice;
8
9 if (argc != 2) {
10 printf("usage: %s file.ogg\n", argv[0]);
11 return 0;
12 }
13
14 if (allegro_init() != 0) {
15 printf("Error initialising Allegro.\n");
16 return 1;
17 }
18
19 if (install_sound(DIGI_AUTODETECT, MIDI_NONE, 0) != 0) {
20 printf("Error initialising sound: %s\n", allegro_error);
21 return 1;
22 }
23 install_timer();
24
25 s = logg_load(argv[1]);
26 if (!s) {
27 printf("Error loading %s\n", argv[1]);
28 return 1;
29 }
30
31 voice = play_sample(s, 255, 128, 1000, 0);
32 rest(s->len*1000/s->freq);
33 destroy_sample(s);
34 return 0;
35 }
36 END_OF_MAIN()
37