This post is a portion of Part 10 in my on going series about 2D Game Development using the Allegro 5 library. These posts are in course order. You can see all of the posts in this course by clicking the “2D Game Development” button at the top of this site.
- 10.0 – It’s Finally Hear!
- 10.1 – Playing a Sample
- 10.2 – Playing Effects
- 10.3 – Sample Instances
The first video of Part 10. In this video we look at the ALLEGRO_SAMPLE variable type. We also see how to load audio samples and play them using audio addon function in Allegro 5.
Full source can be found here.
I get this error:
al_play_sample: Assertion `spl’ failed
Also a warning that doesn’t occur in other source files:
./PlaySample.cpp:18:7: warning: variable ‘keys’ set but not used [-Wunused-but-set-variable]
I had the same error as Ferol on this, installing the optional dependencies on http://wiki.allegro.cc/index.php?title=Install_Allegro5_From_SVN/Linux/Debian did the trick for me =).
The problem is that loading your sample fails and then it has the value NULL.
After installing the packages I had to recompile allegro (forgot to mention).
Thank you psam.
I forgot to compile libvorbis and libogg on my MacOS Lion
Hey ! I’ve got a problem. I can’t load audio, the program just crashes. I’ve spent an hour or so trying to fix it. I tried commenting out line by line of audio code and when I commented out only al_install_audio(); and leaving everything else, the application crashed.. I’m pretty sure that the problem is in that line. Tried to reinstall and all kind of stuff but nothing :/
Also, got this -> Fault Module Name: allegro-5.0.10-monolith-md.dll
Tried reinstalling that .dll but nothing
Try using allegro-5.0.10-monolith-md-debug.dll instead of the release version (in the properties under the linker tab).