|
Can only load .ogg?? |
Dizzy Egg
Member #10,824
March 2009
|
HELP! I'm desperately SpeedHacking and I now have audio, but the only audio files I can successfully load are .ogg files; I want to use .it files for the background music, but al_load_sample fails on anything but .ogg!!! PLEASE HELP AND FAST, TIME IS AGAINST ME!!! EDIT: Nevermind, git it working...audio streams!! RTFM! EDIT EDIT: If someone could provide me a basic example of sensible figures for filling up the stream etc I'd be eternally grateful!!
---------------------------------------------------- |
SiegeLord
Member #7,827
October 2006
|
1#include <allegro5/allegro.h>
2#include <allegro5/allegro_audio.h>
3#include <allegro5/allegro_acodec.h>
4#include <stdio.h>
5
6int main(int argc, char** argv)
7{
8 al_init();
9 al_install_audio();
10 al_init_acodec_addon();
11 al_reserve_samples(1); // to create the default mixer/voice
12
13 ALLEGRO_AUDIO_STREAM* stream = al_load_audio_stream(argv[1], 3, 1024);
14 al_attach_audio_stream_to_mixer(stream, al_get_default_mixer());
15
16 while(al_get_audio_stream_playing(stream))
17 {
18 al_rest(0.1);
19 }
20}
"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Dizzy Egg
Member #10,824
March 2009
|
Thanks SiegeLord!
---------------------------------------------------- |
|