Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » sound initialisation

This thread is locked; no one can reply to it. rss feed Print
sound initialisation
Neil Walker
Member #210
April 2000
avatar

Hello,
A simple question, if either detect_digi_driver() or detect_midi_driver() fails, will calling install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT) pass or fail?

There seems to be two different detection routines but only one install, so how do you know if either actually fails at the install_sound call?

Thanks.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Sirocco
Member #88
April 2000
avatar

From the manual:

Quote:

Returns zero if the sound is successfully installed, and -1 on failure. If it fails it will store a description of the problem in allegro_error.

Hopefully that will be enough to work with, but I understand where you're coming from. Seems like if either one fails, install_sound fails.

-->
Graphic file formats used to fascinate me, but now I find them rather satanic.

scriptX
Member #6,574
November 2005
avatar

Is this what you're asking?

if (detect_digi_driver(ABC) && detect_digi_driver(ABCD)) {
  install_sound(ABC, ABCD);
} else if (detect_digi_driver(ABC)) {
  install_sound(ABC, MIDI_NONE);
} else if (detect_digi_driver(ABCD)) {
  install_sound(DIGI_NONE, ABCD);
}

Might be wrong, I've never done that before.. just thought of it on the spot.

Synapse Jumps
Member #3,073
December 2002

can you pass DIGITAL_AUTODETECT to detect_digi_driver?

If you can, I'd say that a call to install_sound with any paramter as the digital (save DIGI_NONE) paramter would fail.

Same goes for MIDI.

Neil Walker
Member #210
April 2000
avatar

Cheers, never thought of reading the manual to see if there was a MIDI_NONE :)

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Go to: