Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Wave audio Sound Routine - Set Volume? (MAC)

Started by leopard, August 05, 2008, 06:44:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


managed to get a MIDI routine working for the mac, now looking at a wave audio routine for sound effects.

I notice the game interface has a slider to set the volume, the files however don't appear to have a function to control this volume, (the MIDI one does)

Q: how is the volume set for sound effects?
My Simutrans on the apple mac homepage


It depends. Currently the MAC uses SDL for graphics and sound. If this does not work, there will be no sound. SDL_mixer will gives MIDI and sound. Allgro has already MIDI-support.

Honestly, I would think the best way would be a native Quickdraw/Quartz Graphics/sound/midi-Driver, like the GDI-driver for windows. I.e. a file like and and so on ...


thats basically what I have done for the midi, "" compiles, and so far works fine.

I can do basically the same for the sound routine, hell the code for the midi rouitne will play mp3's it will play anything quicktime can do.

Just wondering if there was a command as for the midi routine to set the volume, not important if there isn't.

plan to get back to the main game when I find out why I'm getting "bad magic number, not a mach-o file" during the compile phase in xcode, don't fancy doing the full interface manually. but it may come to that.

managed to port a simple SDL program to cocoa (joystick example prog) with a few lines of code, basically very easy, just need to get the compile sorted.

but making it a universal binary more or less requires it to be in xcode.

still working
My Simutrans on the apple mac homepage



found the bit to set the voulme

My Simutrans on the apple mac homepage


ok this works, in theory but not in practice.

issue #1, the game is passing a mangled file name

specifically something like


not too hard to resolve, with a bit of demangling, the file appears to be loaded into my little sound list fine. hell even rigged it to play every sound as they are first loaded.

the game loads horse.wav, and no other file

the routine to play the sounds is never called...

My Simutrans on the apple mac homepage


interestingly using the file as opposed to my file leads to exactly the same results, a mangled filename leading to a failure to load, but also the play routine never firing.
My Simutrans on the apple mac homepage