Tao.Sdl SDK Documentation

SdlMixer Class

SdlMixer is a simple multi-channel audio mixer. It supports 8 channels of 16 bit stereo audio, plus a single channel of music, mixed by the popular MikMod MOD, Timidity MIDI and SMPEG MP3 libraries.

The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the following music formats via MikMod: .MOD .S3M .IT .XM. It can load Ogg Vorbis streams as music if built with the Ogg Vorbis libraries, and finally it can load MP3 music using the SMPEG library.

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.

For a list of all members of this type, see SdlMixer Members.

System.Object
   Tao.Sdl.SdlMixer

[Visual Basic]
MustInherit NotInheritable Public Class SdlMixer
[C#]
public abstract sealed class SdlMixer

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

This assumes you have gotten SDL_mixer and installed it on your system. SDL_mixer has an INSTALL document in the source distribution to help you get it compiled and installed. SDL_mixer supports playing music and sound samples from the following formats:

                - WAVE/RIFF (.wav)
                - AIFF (.aiff)
                - VOC (.voc)
                - MOD (.mod .xm .s3m .669 .it .med and more) using included mikmod
                - MIDI (.mid) using timidity or native midi hardware
                - OggVorbis (.ogg) requiring ogg/vorbis libraries on system
                - MP3 (.mp3) requiring SMPEG library on system
                - also any command-line player, which is not mixed by SDL_mixer...
                

When using SDL_mixer functions you need to avoid the following functions from SDL:

                SDL_OpenAudio
                Use Mix_OpenAudio instead.
                SDL_CloseAudio
                Use Mix_CloseAudio instead.
                SDL_PauseAudio
                Use Mix_Pause(-1) and Mix_PauseMusic instead, to pause.
                Use Mix_Resume(-1) and Mix_ResumeMusic instead, to unpause.
                SDL_LockAudio
                This is just not needed since SDL_mixer handles this for you.
                Using it may cause problems as well.
                SDL_UnlockAudio
                This is just not needed since SDL_mixer handles this for you.
                Using it may cause problems as well. 

You may call the following functions freely:

                SDL_AudioDriverName
                This will still work as usual.
                SDL_GetAudioStatus
                This will still work, though it will likely return
                SDL_AUDIO_PLAYING even though SDL_mixer is just playing silence.
                It is also a BAD idea to call SDL_mixer and SDL audio
                functions from a callback. Callbacks include Effects
                functions and other SDL_mixer audio hooks. 

Requirements

Namespace: Tao.Sdl

Assembly: Tao.Sdl (in Tao.Sdl.dll)

See Also

SdlMixer Members | Tao.Sdl Namespace