Projects
AGS Engine | Audio | Disable MIDI entirely |
---|---|---|
Radiant | Many AGS games these days don't use MIDI music, but instead use MP3/OGG. Nevertheless, by default AGS initializes a MIDI driver, which may in uncommon situations fail (as some computers just can't handle MIDI for whatever reason). I would like to request an option, either in the game properties tab in the editor, or by writing it manually in the [disabled] section of acsetup.cfg, to disable MIDI entirely. If this is set, the pulldown for MIDI in the winsetup should be disabled (grayed out) and the game should not attempt to initialize the MIDI driver; any functions that attempt to play MIDI music should simply fail and return false. (note that selecting 'disable music' in the MIDI pulldown disables [i]all[/i] music, including MP3/OGG, so this isn't the option we're looking for) | |
Radiant | Thinking about it some more, a better (and simpler) approach would probably be the following: Currently, if you use winsetup to disable MIDI music, the engine disables all music. Expected behavior would be for PlayMusic() and related functions to still work with OGG and MP3 music. | |
Radiant | Furthermore, on Mac/Linux systems this can cause the error "DIGMID patch not found", which apparently disables all music. | |
Radiant | The logs also contain the line "Initializing MOD/XM player". I would suggest that, unless the project file actually contains a MOD or XM file, this step is skipped. Likewise, I would suggest that, unless the project actually contains a MIDI file, the MIDI driver doesn't initialize. Most games use only MP3/OGG music, after all, and there's no need to load a separate player (which may not be installed on some systems) if the game doesn't actually use it. | |
Crimson Wizard | [quote author=Radiant link=issue=552.com1110#com1110 date=1397684195] (note that selecting 'disable music' in the MIDI pulldown disables [i]all[/i] music, including MP3/OGG, so this isn't the option we're looking for) [/quote] I had to test this out because it sounds like a separate issue. But I do not observe this behavior (tried AGS 3.2.1, 3.3.4). [quote author=Radiant link=issue=552.com1114#com1114 date=1398162124] Currently, if you use winsetup to disable MIDI music, the engine disables all music. Expected behavior would be for PlayMusic() and related functions to still work with OGG and MP3 music. [/quote] Does it happen specifically with PlayMusic()? I tried AudioClip.Play() so far, gotta test that too. [b]EDIT[/b]: Right, this happens with PlayMusic(). Ironically I fixed this for 3.3.4 just couple of days ago: [quote] - Fixed MIDI music refuses to start if digital sound is disabled. [/quote] | |
Crimson Wizard | AGS 3.3.4 now tries to run with MIDI disabled, if it failed. But I do not have full confidence in this solution. It must be tested more. | |
Radiant | My preference would be to have an option in game properties to Enable MIDI (true/false). These days, most games can be expected to use OGG/MP3 music instead, so they can leave it disabled and have the engine skip all MIDI-related functionality. |