Skip to main content
Topic: Wave audio Sound Routine - Set Volume? (MAC) (Read 16517 times) previous topic - next topic

Wave audio Sound Routine - Set Volume? (MAC)

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?

Re: Wave audio Sound Routine - Set Volume?

Reply #1
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 ...

Re: Wave audio Sound Routine - Set Volume?

Reply #2
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


Re: Wave audio Sound Routine - Set Volume?

Reply #4
ok this works, in theory but not in practice.

issue #1, the game is p****ing 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

Re: Wave audio Sound Routine - Set Volume?

Reply #5
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.