File: stream_ogg.c

package info (click to toggle)
allegro4.4 2%3A4.4.2-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 19,920 kB
  • ctags: 39,951
  • sloc: ansic: 164,225; asm: 17,620; cpp: 3,848; objc: 1,687; sh: 1,131; python: 676; pascal: 179; makefile: 48; perl: 29; lisp: 1
file content (36 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdio.h>

#include "logg.h"

int main(int argc, char** argv)
{
	LOGG_Stream* s;

	if (argc != 2) {
		printf("usage: %s file.ogg\n", argv[0]);
		return 0;
	}

	if (allegro_init() != 0) {
		printf("Error initialising Allegro.\n");
		return 1;
	}

	if (install_sound(DIGI_AUTODETECT, MIDI_NONE, 0) != 0) {
		printf("Error initialising sound: %s\n", allegro_error);
		return 1;
	}
	install_timer();

	s = logg_get_stream(argv[1], 255, 128, 1);
	if (!s) {
		printf("Error getting ogg stream.\n");
		return 1;
	}
	while (logg_update_stream(s)) {
		rest(1);
	}
	logg_destroy_stream(s);
	return 0;
}
END_OF_MAIN()