PDA

View Full Version : SqueakLib v0.2.1


aarku
2005.02.25, 07:39 PM
SqueakLib is a small library I put together for game audio. It is based off of SWSounds, a utility in SpriteWorld. It has been separated from SpriteWorld, cleaned up a little, the documentation extended, legacy stuff removed, and a couple of things added.

It is released under the zlib/libpng license, like SpriteWorld, so feel free to use it. There is currently one example, SimpleSqueakingCocoa, in the Examples folder. There is a prebuilt executable within its build folder. The libSqueakLib.a is also prebuilt.

Full documentation is pointed to in the DOCUMENTATION.txt file.

Download it here: http://www.tc.umn.edu/~czec0035/files/SqueakLib-v0.2.1.tar.gz

I may or may not continue to work on this. I do not think a strict Carbon example is neccsary, since it is so easy to take a look at MySqueakView.m and .h to figure out what to do. It is well commented. If you want something more complicated, check out OpenAL.

A note on the looping music: SqueakLib loops audio fine, but junglebeat.mp3 was made quickly and probably isn't looped properly.


Using SqueakLib:

Add libSqueakLib.a and SqueakLib.h to your project, and add the appropriate header and library search paths to your project.
Add the Carbon and QuickTime frameworks, if they are not already in your project.
Call: slInit(numberOfChannels);
Call: one of the loading functions like: slLoadSoundFromBundle("audio", "squeak.mp3", &squeakSoundID);
Call: one of the playing functions like: slPlaySound(squeakSoundID, 0, kFindEmptyChannel);
Call: slExit(); when you are completely done with SqueakLib.

See the SimpleSqueakingCocoa example and the documentation for more information.

-Jon

kberg
2005.02.26, 12:53 AM
<mr burns hand wringing..> Excellent... </had wringing>

This looks to be an excellent audio library for games, thanks for releasing it!

Malarkey
2005.02.27, 06:50 PM
Hm, I've been trying to integrate the library into one of my own projects with little success. So I tried rebuilding the example application but then got the following link errors:

ld: warning -L: directory name (/Users/aarku/SqueakLib-v0.2/build) does not exist
ld: can't locate file for: -lSqueakLib

The second error is the one I've been getting in my own project. Anyway, has anyone else had any success using SqueakLib or am I just doing something horribly wrong?

aarku
2005.02.28, 01:03 AM
The example project is fixed. You can download the new version, 0.2.1, by following the link in the first post here.

As for your project, you will need to add the correct header search path and library search path to both your Development and Deployment setting. Do this by getting info on the project icon in your project window in Xcode, and setting the search paths in the Styles tab. Check out SimpleSqueakingCocoa to see how you can do relative paths in there. Good luck!

On a side note, is anyone interested in this as a framework too? I can add another target to the SqueakLib project file for it, if anyone is interested in it.

-Jon