Audio and Mixer Improvements

This merge request mainly:

  • Upgrades SDL_Mixer_X to Version 2.6.0.
  • Updates mixer_sound.c.
  • CMake (and vcpkg by extension) can now find and compile with SDL_Mixer_X libraries.
  • Does fun audio stuff that I'll explain later.
  • Exposes some sound and channel stuff to other scripts.
  • Improves small bugs, like names in the Sound Test stretching past the box length.
  • Stops Closed Captioning from playing a beep sound every time the game starts up oh my goodness that gets on my nerves so bad
  • Adds the feature from Ring Racers that allows for having multiple MUSICDEF lumps in a file.
  • You can now play sounds in Lua either by using a string or sound number.

Some new commands have been added:

  • cv_samplerate - Controls the sample rate of all audio.
  • cv_buffersize - Controls the audio mixer's buffer size.

Additional DLLs have also been added and replaced.

  • libfluidlite.dll now replaces libfluidsynth-2.dll.
  • libwinpthread-1.dll and libstdc++-6.dll have been added.
  • libgcc_s_sjlj-1.dll has been removed.
  • x86_64 systems:
    • libgcc_s_seh-1.dll has been added.
  • i686 systems:
    • libgcc_s_dw2-1.dll has been added.
  • Fluidsynth, Timidity, and the loading and playback of MIDIs, has also been improved as well.

FUNCTIONS:
Revamped functions include:

  • S_SpeedMusic
    • Now works with OGG files and more formats.
  • S_SetInternalMusicVolume
    • Minorly modified, just stores internal volume values in a variable, allowing for the internal volume to be grabbed and returned.
  • S_StopSoundByNum
    • Added it to BLua.

New functions include:

  • float S_GetSpeedMusic
  • void S_PitchMusic (NOTE: Only works with OpenMPT, GME, and MIDI formats, due to SDL_Mixer-X restrictions.)
  • float S_GetPitchMusic
  • INT32 S_GetInternalMusicVolume
  • void S_SetInternalSfxVolume
  • INT32 S_GetInternalSfxVolume
  • float S_SpeedSound,S_SpeedSoundByID, S_SpeedSoundByNum

All of these new functions can now be used with BLUA as well.

Hardcoded functions:

  • void S_StartSoundName, S_StartSoundNameFromEverywhere, S_StartSoundNameFromMobj, S_StartSoundNameFromSector
    • NOTE: These doesn't really have a use yet, I was going to make it work alongside Lua but I just ended up making a seperate function for that, so maybe this could just be unused until 2.3 or something like that

Test addons to mess around with:

TSoURDt3rdAudio_PlaySound.pk3

TSoURDt3rdAudio_SpeedAudio.pk3

Videos:

leaks_to_the_tenth_power leaks_to_the_twentyith_power

Edited by StarManiaKG

Merge request reports

Loading