News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Wave audio Sound Routine - Set Volume? (MAC)

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

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

leopard

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 xxx_sound.cc 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 http://www.aleopardstail.com/simutrans/Index.html

prissi

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 simsys_cocoa16.cc and sound_cocoa.cc and so on ...

leopard

thats basically what I have done for the midi, "core-audio.midi.mm" 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 http://www.aleopardstail.com/simutrans/Index.html

leopard

ahem.


found the bit to set the voulme


*opppps*
My Simutrans on the apple mac homepage http://www.aleopardstail.com/simutrans/Index.html

leopard

ok this works, in theory but not in practice.

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

specifically something like

simgamepath/pak/sound//user/username/simgamepath/sound/file.wav

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...

hmmm
My Simutrans on the apple mac homepage http://www.aleopardstail.com/simutrans/Index.html

leopard

interestingly using the sdl_sound.cc file as opposed to my core-audio_sound.mm 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 http://www.aleopardstail.com/simutrans/Index.html