Module: Quake::Sound::MixerLib

Extended by:
FFI::Library
Defined in:
lib/quake/sound/mixer.rb

Overview

Low-level FFI bindings to SDL2_mixer for WAV playback.

Constant Summary collapse

MIX_DEFAULT_FORMAT =

AUDIO_S16LSB

0x8010

Class Method Summary collapse

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


51
# File 'lib/quake/sound/mixer.rb', line 51

def self.available? = AVAILABLE

.library_namesObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/quake/sound/mixer.rb', line 12

def self.library_names
  env = ENV["QUAKE_SDL2_MIXER"]
  return [env] if env && !env.empty?

  host_os = RbConfig::CONFIG["host_os"]
  case host_os
  when /darwin/
    [
      "SDL2_mixer",
      "libSDL2_mixer.dylib",
      "/opt/homebrew/lib/libSDL2_mixer.dylib",
      "/usr/local/lib/libSDL2_mixer.dylib"
    ]
  when /mingw|mswin/
    ["SDL2_mixer.dll", "libSDL2_mixer.dll"]
  else
    ["SDL2_mixer", "libSDL2_mixer.so", "libSDL2_mixer-2.0.so.0"]
  end
end