Advertisement
Guest User

Allegro

a guest
Sep 25th, 2016
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. #include <allegro5/allegro.h>
  2. #include <allegro5/allegro_audio.h>
  3. #include <allegro5/allegro_acodec.h>
  4.  
  5. int main(int argc, const char** argv)
  6. {
  7.     al_init();
  8.     al_install_audio();
  9.     al_init_acodec_addon();
  10.     al_reserve_samples(1);
  11.     //char *stream_file = "/usr/share/example-content/Ubuntu_Free_Culture_Showcase/Jenyfa Duncan - Australia.ogg"; // this works fine
  12.     char *stream_file = "/home/josh/Radix - Bright eyes.xm"; // this doesn't work and causes a segfault using the upstream code
  13.     ALLEGRO_AUDIO_STREAM* stream = al_load_audio_stream(stream_file, 4, 2048);
  14.     al_attach_audio_stream_to_mixer(stream, al_get_default_mixer());
  15.  
  16.     while(al_get_audio_stream_playing(stream)) {
  17.         al_rest(0.5);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement