• Stars
    star
    336
  • Rank 121,395 (Top 3 %)
  • Language
    C
  • License
    zlib License
  • Created over 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An audio mixer that supports various file formats for Simple Directmedia Layer.
SDL_mixer 3.0

The latest version of this library is available from GitHub:
https://github.com/libsdl-org/SDL_mixer/releases

Due to popular demand, here is a simple multi-channel audio mixer.
It supports 8 channels of 16 bit stereo audio, plus a single channel of music. It can load FLAC, MP3, Ogg, VOC, and WAV format audio. It can also load MIDI, MOD, and Opus audio, depending on build options (see the note below for details.)

See the header file SDL_mixer.h and the examples playwave.c and playmus.c for documentation on this mixer library. This documentation is also available online at https://wiki.libsdl.org/SDL_mixer

The process of mixing MIDI files to wave output is very CPU intensive, so if playing regular WAVE files sound great, but playing MIDI files sound choppy, try using 8-bit audio, mono audio, or lower frequencies.

If you have built with FluidSynth support, you'll need to set the SDL_SOUNDFONTS environment variable to a Sound Font 2 (.sf2) file containing the musical instruments you want to use for MIDI playback.
(On some Linux distributions you can install the fluid-soundfont-gm package)

To play MIDI files using Timidity, you'll need to get a complete set of GUS patches from:
http://www.libsdl.org/projects/mixer/timidity/timidity.tar.gz
and unpack them in /usr/local/lib under UNIX, and C:\ under Win32.

This library is under the zlib license, see the file "LICENSE.txt" for details.

Note:
Support for software MIDI, MOD, and Opus are not included by default because of the size of the decode libraries, but you can get them by running external/download.sh
- When building with CMake, you can enable the appropriate SDL3MIXER_* options defined in CMakeLists.txt. SDL3MIXER_VENDORED allows switching between system and vendored libraries.
- When building with configure/make, you can build and install them normally and the configure script will detect and use them.
- When building with Visual Studio, you will need to build the libraries and then add the appropriate LOAD_* preprocessor define to the Visual Studio project.
- When building with Xcode, you can edit the config at the top of the project to enable them, and you will need to include the appropriate framework in your application.
- For Android, you can edit the config at the top of Android.mk to enable them.

The default MP3 support is provided using dr_mp3. SDL_mixer also supports using libmpg123: you can enable it by passing --enable-music-mp3-mpg123 to configure.

More Repositories

1

SDL

Simple Directmedia Layer
C
8,335
star
2

SDL_image

Image decoding for many popular formats for Simple Directmedia Layer.
C
453
star
3

SDL_ttf

Support for TrueType (.ttf) font files with Simple Directmedia Layer.
C
312
star
4

sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
C
184
star
5

SDL_net

A simple, cross-platform wrapper over TCP/IP sockets.
C
163
star
6

SDL_shader_tools

Shader compiler and tools for SDLSL (Simple Directmedia Layer Shader Language)
C
130
star
7

SDL-1.2

Simple Directmedia Layer, 1.2 branch ... ***DEPRECATED***, please use https://github.com/libsdl-org/SDL for new projects!
C
81
star
8

sdlwiki

This is the raw contents of SDL's wiki. You can edit this through GitHub or at https://wiki.libsdl.org/ now!
63
star
9

sdl2-compat

An SDL2 compatibility layer that uses SDL3 behind the scenes.
C
59
star
10

SDL_rtf

Support for Rich Text Format (.rtf) files with Simple Directmedia Layer.
C
31
star
11

ghwikipp

A slight improvement on GitHub's current wiki support.
PHP
28
star
12

setup-sdl

GitHub action for providing SDL.
JavaScript
17
star
13

SDL_gesture

SDL2's gesture API split out into a single-header library.
C
15
star
14

libtiff

TIFF decoding library from https://gitlab.com/libtiff/libtiff
C
12
star
15

GUIlib

Simple (and unmaintained!) GUI library built on SDL. Not recommended for new code!
Shell
11
star
16

Maelstrom

Maelstrom 3.0
C++
11
star
17

sdlweb

The website for Simple Directmedia Layer.
PHP
11
star
18

SDL-historical-archive

This is a snapshot of SDL's complete Mercurial repository when we migrated to GitHub. This is is just for historical purposes.
C
8
star
19

SDL_helloworld

A Hello World project that uses SDL.
C
7
star
20

jpeg

JPEG decoding library from https://www.ijg.org/
C
6
star
21

mpg123

mpg decoding library from http://mpg123.de/
C
5
star
22

aom

AV1 Codec Library, forked from https://aomedia.googlesource.com/aom/
C
1
star