OK, so I'm working on this alarm app, and having trouble with the audio addon. I installed everything from svn but I can't seem to figure out why I can't create an audio stream from an ogg file.
here is my code so far:
The file exists so that isn't the problem. Am I doing something wrong here? Should I be using another part of the audio api? The ogg file was created by ripping a song off of a CD and saving it as an OGG file. Could this be because the song settings differ from the mixer settings?
Thanks for any help.
WG
Do you ever attach the audio stream to something (i.e., a mixer)?
By the way, if you don't care much about the settings of mixers and voices, you can do this:
al_install_audio(); al_init_acodec_addon(); al_reserve_samples(n); // sets up a default mixer/voice al_attach_audio_stream_to_mixer(stream, al_get_default_mixer());
I got it working by converting the ogg file to WAV format.
I did attach it to a mixer but only if the alarm time is greater than or equal to the clock time... As of now, everything is working, but I don't understand why the load stream function failed for an ogg file but not for a wav file. I installed from svn, and it always is a pain but I thought I finally got everything where I needed it.
For what reasons would the load stream function fail? If I just reserve samples, how would I go about loading the entire file from disk before playing?
I'm just glad to finally have audio working at all with A5. Of all the A5 versions I've tried this is the first one that audio has worked period.
WG
Are the ogg, vorbis and vorbisfile DLLs in your path? The best way to debug these things is to use a debug build of Allegro and check allegro.log
What operating system is this? Confirm that Allegro really did build with Ogg support. I had significant issues getting that to work on OSX due to what I can only assume is a bug in Allegro's cmake scripts, and for all I know that issue exists on other systems, too.
Are the ogg, vorbis and vorbisfile DLLs in your path? The best way to debug these things is to use a debug build of Allegro and check allegro.log
All of the DLLs were installed as far as I know but I will go back through and double check.
What operating system is this? Confirm that Allegro really did build with Ogg support. I had significant issues getting that to work on OSX due to what I can only assume is a bug in Allegro's cmake scripts, and for all I know that issue exists on other systems, too.
I'm building this on Windows Vista, and have had similar problems on XP as well.
The only files I had trouble with in cmake were the ogg and vorbis files. I had to manually add those 3 files into cmake. For some reason, no matter what I did, cmake would find the include directories but not the library files. But, when I ran the final configure, cmake did the checks to see if ogg and vorbis compiled and that worked fine.
I'll check this out some more and let you guys know how it goes. I was going to post the steps I took to install from SVN on windows on the wiki sometime today as well. This last time went much smoother than before.
Note that in my case there were no error messages from cmake either. It just silently failed and excluded ogg, while building everything else.
I just checked and the ogg and vorbis dll files WERE copied during install but I'm not seeing the library files. I'm going to try this again after copying those library files.
[Edit]
Ok, still no luck after that try. Obviously A5 built without OGG support. Is there a way to fix the cmake scripts to properly find the libraries? I have all the dependencies in the deps folder. Should I have copied over the library export files along with the .lib files?
[Edit #2]
Ok, the problem has been resolved. What happened was that I had renamed libogg.lib and libvorbis*.lib in the deps folder in hopes of the cmake scripts automatically finding them. Because of that, the program was looking for the wrong dll files. copying over the original .lib and .dll files and relinking fixed everything. Thanks for all the help folks.
WG