[Top] | [Contents] | [Index] | [ ? ] |
1. Overview | The README from the MixerX distribution | |
2. MixerX | About MixerX (a.k.a. SDL Mixer X) fork | |
3. Getting Started | Using SDL_mixer | |
4. Conflicts | Conflicts with SDL Audio functions | |
5. Functions | Functions supported by the SDL_mixer API | |
6. Types | Types used with the SDL_mixer API | |
7. Defines | Defined values/macros in the SDL_mixer API | |
8. Glossary | Terms used in this document | |
Index | Index of selected words |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A Little Bit About Me (author of original manual)
I am currently, as I write this document, a programmer for Raytheon. There I do all sorts of communications, network, GUI, and other general programming tasks in C/C++ on the Solaris and sometimes Linux Operating Systems. I have been programming sound code in my free time for only a little while now. Sound is an integral part to any game. The human senses are mostly starved during video game play. there’s only some tactile feedback on some controlers, and of course the eyes are in use but only for about 30% of their viewing area. So to add more we do need sound to help the game player feel more in the action, and to set certain moods as the game progresses. Sound ends up accounting for perhaps 50% or more of a gamers experience. Music and sound effects are all integral parts of the gaming experience. While this document doesn’t explain how to get music and samples to use, it will explain how to use them with SDL_mixer.
Feel free to contact me: JonathanCAtkins@gmail.com
I am also usually on IRC at irc.freenode.net in the #SDL channel as LIM
This is the README in the SDL_mixer source archive.
SDL Mixer X The latest version of this library is available from: Due to popular demand, here is a simple multi-channel audio mixer. It supports 8 or more channels of 16 bit or more stereo audio, plus a single or multiple channels of music, mixed by the popular LibXMP/ModPlug MOD, Timidity/FluidSynth MIDI (also, libADLMIDI and libOPNMIDI), OGG Vorbis, FLAC, Opus, and MPG123 MP3 libraries. See the header file SDL_mixer_ext.h and the examples playwave.c and playmus.c for documentation on this mixer library. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity/FluidSynth/libADLMIDI/libOPNMIDI and the following music formats via libXMP or ModPlug: .MOD .S3M .IT .XM. etc. It can load Ogg Vorbis / Opus / FLAC streams as music if built with related libraries, can play chiptunes via GME library if built with it, and finally it can load MP3 music using the DRMP3 or MPG123 library. The process of mixing MIDI files to wave output in dependence on a synthesizer 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. To play MIDI files with use of Timidity synthesizer, you’ll need to get a complete set of GUS patches from: Timidity GUS Patches and unpack them in /usr/local/lib under UNIX, and C:\ under Win32. Since SDL_mixer 2.x MIDI files can be played through native MIDI API of operating system (supported Windows, macOS and Haiku) or through FluidSynth. With SDL Mixer X fork you can use libADLMIDI and libOPNMIDI synthesizers are working always and doesn’t requiring any external sound fonts or banks. libADLMIDI and libOPNMIDI are FM synthesizers using emulators of YMF232 by libADLMIDI (OPL3), and YM2612 (OPN2) or YM2608 (OPNA) by libOPNMIDI. With SDL Mixer X it’s possible to switch MIDI synthesizer in real time while with original SDL Mixer it’s only possible to set MIDI synthesizer by environment variable only in a moment of library loading. The SDL_mixer 1.x library is available under the GNU Library General Public License, see the file "COPYING" for details. The SDL_mixer 2.x and SDL Mixer X fork library is available under the ZLib License, see the file "COPYING" for details. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
It’s an extended fork of the SDL_mixer library made by Vitaly Novichkov "Wohlstand" in 13 January 2015. SDL_mixer is a quick and stable high-quality audio library, however, it has own bunch of deffects and lack of certain abilities such as inability to choose the MIDI backend in runtime, No support for cross-fade and parallel streams playing (has only one musical stream. Using of very long Chunks is ineffectively), etc. The goal of this fork is resolving those issues, providing more extended functionality than was originally, and providing support for more supported audio formats.
In this documentation, new-added functions, definitions, and enums in this fork will be marked by [Mixer X] label. That means those functions are existing only in SDL Mixer X fork and wasn’t existed in original SDL_mixer library.
This fork is based on SDL_mixer 2.x unlike original documentation which is created for SDL_mixer 1.2. Some functions would be marked by [Mixer X] label which means those functions are not available in SDL_mixer 1.x, but available in SDL_mixer 2.0 and SDL Mixer X fork.
IMPORTANT: The license for libADLMIDI, libOPNMIDI, libGME with MAME YM2612 emulator is GPL which means that in order to use it your application must also be GPL!
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This assumes you have gotten SDL Mixer X and installed it on your system. SDL_mixer has an INSTALL document in the source distribution to help you get it compiled and installed.
Generally, installation consists of:
|
SDL Mixer X 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) requiring libxmp or libmodplug [Mixer 2.0] built in package
- MIDI (.mid) using timidity, FluidSynth [Mixer 2.0], libADLMIDI [Mixer X], libOPNMIDI [Mixer X], libEDMIDI [Mixer X] or native midi hardware
- OggVorbis (.ogg) requiring ogg/vorbis libraries built in package, or stb_vorbis enabled isntead
- MP3 (.mp3) requiring MPG123 library built in package, or DRMP3 enabled instead
- FLAC (.flac) requiring the FLAC library built in package, or DRFLAC enabled instead
- Opus (.opus) requiring the Opus/OpusFile library built in package
- GME (.spc .nsf .hes .vgm and more) requiring the libGME library built in package [Mixer X]
- also any command-line player, which is not mixed by SDL Mixer X...
You may also want to look at some demonstration code which may be downloaded from:
http://www.jonatkins.org/SDL_mixer/
3.1 Includes | The include files to use for SDL_mixer | |
3.2 Compiling | Using the SDL_mixer library and header file. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To use MixerX functions in a C/C++ source code file, you must use the SDL_mixer_ext.h include file:
|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To link with SDL MixerX you should use sdl-config to get the required SDL
compilation options. After that, compiling with MixerX is quite easy.
Note: Some systems may not have the SDL_mixer library and include file in the same place as the SDL library and includes are located, in that case you will need to add more -I and -L paths to these command lines.
Simple Example for compiling an object file:
Simple Example for linking a program:
|
Now myprogram
is ready to run.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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
MIXER-X:
Use Mix_PauseAudio(0)
instead, to pause.
Use Mix_PauseAudio(1)
instead, to pause.
SDL_mixer:
Use Mix_Pause(-1)
and Mix_PauseMusic
instead, to pause.
Use Mix_Resume(-1)
and Mix_ResumeMusic
instead, to unpause.
SDL_LockAudio
Use Mix_LockAudio
instead.
SDL_UnlockAudio
Use Mix_UnlockAudio
instead.
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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These are the functions in the SDL_mixer API.
5.1 General | API activation | |
5.2 Samples | Loading sounds from files or memory | |
5.3 Channels | Sound effect channels | |
5.4 Groups | Sound effect channel grouping | |
5.5 Music | Music playing | |
5.6 Effects | Special effects processing |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions are useful, as they are the only/best ways to work with SDL_mixer.
Info | ||
---|---|---|
5.1.1 Mix_Linked_Version | Get version number | |
Activation | ||
5.1.2 Mix_Init | Initialize SDL_mixer | |
5.1.3 Mix_Quit | Cleanup SDL_mixer | |
5.1.4 Mix_OpenAudio | Open sound mixer | |
5.1.5 Mix_OpenAudioDevice | Open sound mixer with specific device [Mixer 2.0] | |
5.1.6 Mix_PauseAudio | Pause or resume the whole audio engine [Mixer X] | |
5.1.7 Mix_CloseAudio | Close sound mixer | |
Manual audio output processing | ||
5.1.8 Mix_InitMixer | Initialize the Mixer internality without audio output [Mixer X] | |
5.1.9 Mix_GetMusicMixer | Get the internal single-stream music mixer callback for manual audio output processing [Mixer X] | |
5.1.10 Mix_GetMultiMusicMixer | Get the internal multi-stream music mixer callback for manual audio output processing [Mixer X] | |
5.1.11 Mix_GetGeneralMixer | Get the inernal gemeral mixer callback for manual audio output processing [Mixer X] | |
5.1.12 Mix_FreeMixer | Deinitialize and free all Mixer inetnality when used without audio output [Mixer X] | |
Errors | ||
5.1.13 Mix_SetError | Set the current error string | |
5.1.14 Mix_GetError | Get the current error string | |
Settings | ||
5.1.15 Mix_QuerySpec | Get output format |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const SDL_version *Mix_Linked_Version()
void SDL_MIXER_VERSION(SDL_version *compile_version)
This works similar to SDL_Linked_Version
and SDL_VERSION.
Using these you can compare the runtime version to the version that you compiled with.
|
See Also:
Mix_OpenAudio,
Mix_QuerySpec
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_Init(int flags)
bitwise OR’d set of sample/music formats to support by loading a library now. The values you may OR together to pass in are:
MIX_INIT_FLAC
MIX_INIT_MOD
MIX_INIT_MP3
MIX_INIT_OGG
MIX_INIT_MID
MIX_INIT_OPUS
Initialize by loading support as indicated by the flags, or at least return success if support is already loaded. You may call this multiple times, which will actually require you to call Mix_Quit
just once to clean up. You may call this function with a 0 to retrieve whether support was built-in or not loaded yet.
Note: you can call Mix_Init
with the right MIX_INIT_* flags OR’d together before you program gets busy, to prevent a later hiccup while it loads and unloads the library, and to check that you do have the support that you need before you try and use it.
Note: this function does not always set the error string, so do not depend on Mix_GetError
being meaningful all the time.
Returns: a bitmask of all the currently initted sample/music loaders.
|
See Also:
Mix_Quit
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_Quit()
This function cleans up all dynamically loaded library handles, freeing memory. If support is required again it will be initialized again, either by Mix_Init
or loading a sample or some music with dynamic support required. You may call this function when Mix_Load functions are no longer needed for the MIX_INIT_* formats. You should call this function for each time Mix_Init
was called, otherwise it may not free all the dynamic library resources until the program ends. This is done so that multiple unrelated modules of a program may call Mix_Init
and Mix_Quit
without affecting the others performance and needs.
|
NOTE: Since each call to Mix_Init
may set different flags, there is no way, currently, to request how many times each one was initted. In other words, the only way to quit for sure is to do a loop like so:
|
See Also:
Mix_Init
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize)
Output sampling frequency in samples per second (Hz).
you might use MIX_DEFAULT_FREQUENCY(44100) since that is a good value for most games.
Output sample format.
Number of sound channels in output.
Set to 2 for stereo, 1 for mono.
This has nothing to do with mixing channels.
Bytes used per output sample.
Initialize the mixer API.
This must be called before using other functions in this library.
SDL must be initialized with SDL_INIT_AUDIO before this call.
frequency would be 44100 for 44.1KHz, which is CD audio rate. Some games use 22050, because 44100 requires too much CPU power on very old computers.
chunksize is the size of each mixed sample. The smaller this is the more your hooks will be called. If make this too small on a slow system, sound may skip. If made to large, sound effects will lag behind the action more. You want a happy medium for your target computer. You also may make this 4096, or larger, if you are just playing music.
MIX_CHANNELS(8) mixing channels will be allocated by default.
You may call this function multiple times, however you will have to call Mix_CloseAudio
just as many times for the device to actually close. The format will not changed on subsequent calls until fully closed. So you will have to close all the way before trying to open with different format parameters.
format is based on SDL audio support, see SDL_audio.h.
Here are the values listed there:
Unsigned 8-bit samples
Signed 8-bit samples
Unsigned 16-bit samples, in little-endian byte order
Signed 16-bit samples, in little-endian byte order
Unsigned 16-bit samples, in big-endian byte order
Signed 16-bit samples, in big-endian byte order
same as AUDIO_U16LSB (for backwards compatability probably)
same as AUDIO_S16LSB (for backwards compatability probably)
Unsigned 16-bit samples, in system byte order
Signed 16-bit samples, in system byte order
Signed 32-bit samples, in little-endian byte order
Signed 32-bit samples, in bin-endian byte order
same as AUDIO_S32LSB (for backwards compatability probably)
Signed 32-bit samples, in system byte order
Floating 32-bit samples, in little-endian byte order
Floating 32-bit samples, in big-endian byte order
same as AUDIO_F32LSB (for backwards compatability probably)
Signed 32-bit float samples, in system byte order
MIX_DEFAULT_FORMAT is the same as AUDIO_S16SYS.
Returns: 0 on success, -1 on errors
|
See Also:
Mix_OpenAudioDevice,
Mix_CloseAudio,
Mix_PauseAudio,
Mix_QuerySpec,
Mix_AllocateChannels,
Mix_OpenAudioDevice
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_OpenAudioDevice(int frequency, Uint16 format, int channels, int chunksize, const char* device, int allowed_changes)
Output sampling frequency in samples per second (Hz).
you might use MIX_DEFAULT_FREQUENCY(44100) since that is a good value for most games.
Output sample format. See Mix_OpenAudio for the table of available formats.
Number of sound channels in output.
Set to 2 for stereo, 1 for mono.
This has nothing to do with mixing channels.
Bytes used per output sample.
A UTF-8 string reported by SDL_GetAudioDeviceName()
or a driver-specific name as appropriate. NULL requests the most reasonable default device.
0, or one or more flags OR’d together.
Initialize the mixer API.
This must be called before using other functions in this library.
SDL must be initialized with SDL_INIT_AUDIO before this call.
frequency would be 44100 for 44.1KHz, which is CD audio rate. Some games use 22050, because 44100 requires too much CPU power on very old computers.
chunksize is the size of each mixed sample. The smaller this is the more your hooks will be called. If make this too small on a slow system, sound may skip. If made to large, sound effects will lag behind the action more. You want a happy medium for your target computer. You also may make this 4096, or larger, if you are just playing music.
MIX_CHANNELS(8) mixing channels will be allocated by default.
You may call this function multiple times, however you will have to call Mix_CloseAudio
just as many times for the device to actually close. The format will not changed on subsequent calls until fully closed. So you will have to close all the way before trying to open with different format parameters.
Returns: 0 on success, -1 on errors
|
See Also:
Mix_OpenAudio,
Mix_CloseAudio,
Mix_PauseAudio,
Mix_QuerySpec,
Mix_AllocateChannels,
Mix_OpenAudio
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_PauseAudio(int pause_on)
Pauses or resume the whole audio processing: all playing music and channels will get paused synchroniously.
1 pauses the whole audio processing, 0 resumes the audio processing back.
See Also:
Mix_OpenAudio,
Mix_OpenAudioDevice,
Mix_CloseAudio,
Mix_QuerySpec,
Mix_AllocateChannels,
Mix_OpenAudio
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_CloseAudio()
Shutdown and cleanup the mixer API.
After calling this all audio is stopped, the device is closed,
and the SDL_mixer functions should not be used.
You may, of course, use Mix_OpenAudio to start the functionality again.
Note: This function doesn’t do anything until you have called it the same
number of times that you called Mix_OpenAudio.
You may use Mix_QuerySpec
to find out how many times Mix_CloseAudio
needs to be called before the device is actually closed.
|
See Also:
Mix_OpenAudio,
Mix_OpenAudioDevice,
Mix_QuerySpec,
Mix_PauseAudio,
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_InitMixer(const SDL_AudioSpec *spec, SDL_bool skip_init_check)
The audio spec such as frequency, sample format, number of channels, and desired chunk size, using the SDL_AudioSpec
structure.
Disable the internal check of the initialization state.
Initialize the mixer API without starting the audio processing. That means, you can make your own audio processing and manually run the mixer API by using callbacks you may retrieve using Mix_GetGeneralMixer, Mix_GetMusicMixer, and Mix_GetMultiMusicMixer calls.
CAUTION: Don’t even try to call this function and any of mixer callback if you initialized the mixer using Mix_OpenAudio or Mix_OpenAudioDevice calls.
See Also:
Mix_GetMusicMixer,
Mix_GetMultiMusicMixer,
Mix_GetGeneralMixer,
Mix_FreeMixer
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_CommonMixer_t Mix_GetMusicMixer()
Returns: The mixer callback to process the single-stream music.
Get the callback to process the single-stream music out of the main process of mixer API
and receive the output of currently playing single-stream music. To receive the
multi-stream music output use the Mix_GetMultiMusicMixer callback.
CAUTION: Don’t even try to call the returned callback if you initialized the mixer using Mix_OpenAudio or Mix_OpenAudioDevice calls.
See Also:
Mix_InitMixer,
Mix_GetMultiMusicMixer,
Mix_GetGeneralMixer,
Mix_FreeMixer
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_CommonMixer_t Mix_GetMultiMusicMixer()
Returns: The mixer callback to process the multi-stream music.
Get the callback to process the single-stream music out of the main process of mixer API
and receive the output of all music streams except the single-stream music. To receive the
single-stream music output use the Mix_GetMusicMixer callback.
CAUTION: Don’t even try to call the returned callback if you initialized the mixer using Mix_OpenAudio or Mix_OpenAudioDevice calls.
See Also:
Mix_InitMixer,
Mix_GetMusicMixer,
Mix_GetGeneralMixer,
Mix_FreeMixer
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_CommonMixer_t Mix_GetMultiMusicMixer()
Returns: The mixer callback to process the general mixer API.
Get the callback to process the general Mixer API out of the main process of mixer API
and receive the generated output of all playing music streams and channels.
CAUTION 1: Don’t even try to call the returned callback if you initialized the mixer using Mix_OpenAudio or Mix_OpenAudioDevice calls.
CAUTION 2: Once you execute the callback returned by Mix_GetGeneralMixer())
,
callbacks returned by Mix_GetMusicMixer()
and Mix_GetMultiMusicMixer()
were
already processed internally. You don’t need to call them at all.
See Also:
Mix_InitMixer,
Mix_GetMusicMixer,
Mix_GetMultiMusicMixer,
Mix_FreeMixer
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_FreeMixer()
Shutdown and cleanup the mixer API.
Use this call in only condition you initialized the mixer API using the Mix_InitMixer call.
CAUTION: Don’t even try to call this function and any of mixer callback if you initialized the mixer using Mix_OpenAudio or Mix_OpenAudioDevice calls.
See Also:
Mix_InitMixer,
Mix_GetMusicMixer,
Mix_GetMultiMusicMixer,
Mix_GetGeneralMixer
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_SetError(const char *fmt, ...)
This is the same as SDL_SetError, which sets the error string which may be fetched with Mix_GetError (or SDL_GetError).
This functions acts like printf, except that it is limited to SDL_ERRBUFIZE(1024) chars in length. It only accepts the following format types: %s, %d, %f, %p
. No variations are supported, like %.2f
would not work. For any more specifics read the SDL docs.
|
See Also:
Mix_GetError
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
char *Mix_GetError()
This is the same as SDL_GetError, which returns the last error set as a string which you may use to tell the user what happened when an error status has been returned from an SDL_mixer function call.
Returns: a char pointer (string) containing a humam readble version or the reason for the last error that occured.
|
See Also:
Mix_SetError
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_QuerySpec(int *frequency, Uint16 *format, int *channels)
A pointer to an int where the frequency actually used by the opened audio device will be stored.
A pointer to a Uint16 where the output format actually being used by the audio device will be stored.
A pointer to an int where the number of audio channels will be stored.
2 will mean stereo, 1 will mean mono.
Get the actual audio format in use by the opened audio device. This may or may not match the parameters you passed to Mix_OpenAudio.
Returns: 0 on error. If the device was open the number of times it was opened will be returned. The values of the arguments variables are not set on an error.
|
See Also:
Mix_OpenAudio
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions work with Mix_Chunk samples.
Loading | ||
---|---|---|
5.2.1 Mix_GetNumChunkDecoders | Number of sample format types that can be decoded | |
5.2.2 Mix_GetChunkDecoder | Name of enumerated sample format type decoder | |
5.2.3 Mix_HasChunkDecoder | Check if the specific chunk decodec is abailable by name in this build | |
5.2.4 Mix_LoadWAV | From a file | |
5.2.5 Mix_LoadWAV_RW | Using RWops | |
5.2.6 Mix_QuickLoad_WAV | From memory, in output format already | |
5.2.7 Mix_QuickLoad_RAW | From memory, in output format already | |
Settings | ||
5.2.8 Mix_VolumeChunk | Set mix volume | |
Freeing | ||
5.2.9 Mix_FreeChunk | Free sample |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetNumChunkDecoders()
Get the number of sample chunk decoders available from the Mix_GetChunkDecoder
function. This number can be different for each run of a program, due to the change in availability of shared libraries that support each format.
Returns: The number of sample chunk decoders available.
|
See Also:
Mix_GetNumMusicDecoders,
Mix_GetChunkDecoder,
Mix_HasChunkDecoder,
Mix_LoadWAV
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_GetChunkDecoder(int index)
The index number of sample chunk decoder to get.
In the range from 0(zero) to Mix_GetNumChunkDecoders()-1, inclusive.
Get the name of the indexed sample chunk decoder.
You need to get the number of sample chunk decoders available using the Mix_GetNumChunkDecoders
function.
Returns: The name of the indexed sample chunk decoder. This string is owned by the SDL_mixer library, do not modify or free it. It is valid until you call Mix_CloseAudio
the final time.
|
See Also:
Mix_GetNumChunkDecoders,
Mix_GetMusicDecoder,
Mix_HasChunkDecoder,
Mix_LoadWAV
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
SDL_bool Mix_HasChunkDecoder(const char *name)
The decoder name to check it’s presence.
Check if the sample chunk decoder named as name presented in this library build.
Returns: SDL_TRUE
if the requested codec name is available in this library build or SDL_FALSE
if not.
See Also:
Mix_GetNumChunkDecoders,
Mix_GetChunkDecoder,
Mix_GetMusicDecoder,
Mix_LoadWAV
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Chunk *Mix_LoadWAV(char *file)
File name to load sample from.
Load file for use as a sample. This is actually Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
. This can load WAVE, AIFF, RIFF, OGG, FLAC, MP3, and VOC files.
Note: You must call SDL_OpenAudio before this. It must know the output characteristics so it can convert the sample for playback, it does this conversion at load time.
Returns: a pointer to the sample as a Mix_Chunk
. NULL is returned on errors.
|
See Also:
Mix_LoadWAV_RW,
Mix_QuickLoad_WAV,
Mix_FreeChunk
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc)
The source SDL_RWops as a pointer. The sample is loaded from this.
A non-zero value mean is will automatically close/free the src for you.
Load src for use as a sample. This can load WAVE, AIFF, RIFF, OGG, FLAC, MP3, and VOC formats.
Using SDL_RWops
is not covered here, but they enable you to load from almost any source.
Note: You must call SDL_OpenAudio before this. It must know the output characteristics so it can convert the sample for playback, it does this conversion at load time.
Returns: a pointer to the sample as a Mix_Chunk
. NULL is returned on errors.
|
See Also:
Mix_LoadWAV,
Mix_QuickLoad_WAV,
Mix_FreeChunk
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Chunk *Mix_QuickLoad_WAV(Uint8 *mem)
Memory buffer containing a WAVE file in output format.
Load mem as a WAVE/RIFF file into a new sample. The WAVE in mem must be already in the output format. It would be better to use Mix_LoadWAV_RW
if you aren’t sure.
Note: This function does very little checking. If the format mismatches the output format, or if the buffer is not a WAVE, it will not return an error. This is probably a dangerous function to use.
Returns: a pointer to the sample as a Mix_Chunk
. NULL is returned on errors.
|
See Also:
Mix_LoadWAV,
Mix_QuickLoad_RAW,
Mix_FreeChunk
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Chunk *Mix_QuickLoad_RAW(Uint8 *mem)
Memory buffer containing a WAVE file in output format.
Load mem as a raw sample. The data in mem must be already in the output format. If you aren’t sure what you are doing, this is not a good function for you!
Note: This function does very little checking. If the format mismatches the output format it will not return an error. This is probably a dangerous function to use.
Returns: a pointer to the sample as a Mix_Chunk
. NULL is returned on errors, such as when out of memory.
|
See Also:
Mix_LoadWAV,
Mix_QuickLoad_WAV,
Mix_FreeChunk
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_VolumeChunk(Mix_Chunk *chunk, int volume)
Pointer to the Mix_Chunk to set the volume in.
The volume to use from 0 to MIX_MAX_VOLUME(128).
If greater than MIX_MAX_VOLUME,
then it will be set to MIX_MAX_VOLUME.
If less than 0 then chunk->volume will not be set.
Set chunk->volume to volume.
The volume setting will take effect when the chunk is used on a channel, being mixed into the output.
Returns: previous chunk->volume setting. if you passed a negative value for volume then this volume is still the current volume for the chunk.
|
See Also:
Mix_Chunk
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_FreeChunk(Mix_Chunk *chunk)
Pointer to the Mix_Chunk to free.
Free the memory used in chunk, and free chunk itself as well. Do not use chunk after this without loading a new sample to it. Note: It’s a bad idea to free a chunk that is still being played...
|
See Also:
Mix_LoadWAV,
Mix_LoadWAV_RW,
Mix_QuickLoad_WAV,
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions work with sound effect mixer channels. Music is not affected by these functions.
Setup | ||
---|---|---|
5.3.1 Mix_AllocateChannels | Set the number of channels to mix | |
5.3.2 Mix_Volume | Set the mix volume of a channel | |
5.3.3 Mix_MasterVolume | Get/Set the general SFX volume | |
Playing | ||
5.3.4 Mix_PlayChannel | Play loop | |
5.3.5 Mix_PlayChannelTimed | Play loop and limit by time | |
5.3.6 Mix_PlayChannelVol | Play loop with seting of initial volume [Mixer X] | |
5.3.7 Mix_PlayChannelTimedVolume | Play loop with seting of initial volume and limit by time [Mixer X] | |
5.3.8 Mix_FadeInChannel | Play loop with fade in | |
5.3.9 Mix_FadeInChannelTimed | Play loop with fade in and limit by time | |
5.3.10 Mix_FadeInChannelVolume | Play loop with seting of initial volume and fade in [Mixer X] | |
5.3.11 Mix_FadeInChannelTimedVolume | Play loop with seting of initial volume and fade in and limit by time [Mixer X] | |
Pausing | ||
5.3.12 Mix_Pause | Pause a channel | |
5.3.13 Mix_Resume | Resume a paused channel | |
Stopping | ||
5.3.14 Mix_HaltChannel | Stop playing on a channel | |
5.3.15 Mix_ExpireChannel | Change the timed stoppage of a channel | |
5.3.16 Mix_FadeOutChannel | Stop playing channel after timed fade out | |
5.3.17 Mix_ChannelFinished | Set callback for when channel finishes playing | |
Info | ||
5.3.18 Mix_Playing | Get the active playing status of a channel | |
5.3.19 Mix_Paused | Get the pause status of a channel | |
5.3.20 Mix_FadingChannel | Get the fade status of a channel | |
5.3.21 Mix_GetChunk | Get the sample playing on a channel |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_AllocateChannels(int numchans)
Number of channels to allocate for mixing.
A negative number will not do anything, it will tell you how many channels are currently allocated.
Set the number of channels being mixed. This can be called multiple times, even with sounds playing. If numchans is less than the current number of channels, then the higher channels will be stopped, freed, and therefore not mixed any longer. It’s probably not a good idea to change the size 1000 times a second though.
If any channels are deallocated, any callback set by Mix_ChannelFinished
will be called when each channel is halted to be freed.
Note: passing in zero WILL free all mixing channels, however music will still play.
Returns: The number of channels allocated. Never fails...but a high number of channels can segfault if you run out of memory. We’re talking REALLY high!
|
See Also:
Mix_OpenAudio
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_Volume(int channel, int volume)
Channel to set mix volume for.
-1
will set the volume for all allocated channels.
The volume to use from 0 to MIX_MAX_VOLUME(128).
If greater than MIX_MAX_VOLUME,
then it will be set to MIX_MAX_VOLUME.
If less than 0 then the volume will not be set.
Set the volume for any allocated channel. If channel is -1
then all channels at are set at once. The volume is applied during the final mix, along with the sample volume. So setting this volume to 64 will halve the output of all samples played on the specified channel. All channels default to a volume of 128, which is the max. Newly allocated channels will have the max volume set, so setting all channels volumes does not affect subsequent channel allocations.
Returns: current volume of the channel. If channel is -1, the average volume is returned.
|
See Also:
Mix_VolumeChunk,
Mix_VolumeMusic,
Mix_VolumeMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_MasterVolume(int *volume)
Set the master volume for all channels.
SDL_mixer keeps a per-channel volume, a per-chunk volume, and a master volume, and considers all three when mixing audio. This function sets the master volume, which is applied to all playing channels when mixing.
The volume must be between 0 (silence) and MIX_MAX_VOLUME (full volume). Note that MIX_MAX_VOLUME is 128. Values greater than MIX_MAX_VOLUME are clamped to MIX_MAX_VOLUME.
Specifying a negative volume will not change the current volume; as such, this can be used to query the current volume without making changes, as this function returns the previous (in this case, still-current) value.
Note: that the master volume does not affect any playing music; it is only applied when mixing chunks. Use Mix_VolumeMusicStream() for that.
The new volume, between 0 and MIX_MAX_VOLUME, or -1 to query.
Returns: The previous volume. If the specified volume is -1, this returns the current volume.
See Also:
Mix_Volume,
Mix_VolumeChunk,
Mix_VolumeMusic,
Mix_VolumeMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_PlayChannel(int channel, Mix_Chunk *chunk, int loops)
Channel to play on, or -1 for the first free unreserved channel.
Sample to play.
Number of loops, -1 is infinite loops.
Passing one here plays the sample twice (1 loop).
Play chunk on channel, or if channel is -1, pick the first free unreserved channel.
The sample will play for loops+1 number of times, unless stopped by halt, or fade out, or setting a new expiration time of less time than it would have originally taken to play the loops, or closing the mixer.
Note: this just calls Mix_PlayChannelTimed()
with ticks set to -1.
Returns: the channel the sample is played on. On any errors, -1 is returned.
|
See Also:
Mix_PlayChannelTimed,
Mix_PlayChannelVol,
Mix_PlayChannelTimedVolume,
Mix_FadeInChannel,
Mix_FadeInChannelTimed,
Mix_FadeInChannelVolume,
Mix_FadeInChannelTimedVolume,
Mix_HaltChannel,
Mix_ExpireChannel,
Mix_ReserveChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk,
int loops, int ticks)
Channel to play on, or -1 for the first free unreserved channel.
Sample to play.
Number of loops, -1 is infinite loops.
Passing one here plays the sample twice (1 loop).
Millisecond limit to play sample, at most.
If not enough loops or the sample chunk is not long enough, then the sample may stop before this timeout occurs.
-1 means play forever.
If the sample is long enough and has enough loops then the sample will stop after ticks milliseconds. Otherwise this function is the same as Mix_PlayChannel.
Returns: the channel the sample is played on. On any errors, -1 is returned.
|
See Also:
Mix_PlayChannel,
Mix_PlayChannelVol,
Mix_PlayChannelTimedVolume,
Mix_FadeInChannelTimed,
Mix_FadeInChannelVolume,
Mix_FadeInChannelTimedVolume,
Mix_FadeOutChannel,
Mix_ReserveChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_PlayChannelVol(int channel, Mix_Chunk *chunk, int loops, int vol)
Channel to play on, or -1 for the first free unreserved channel.
Sample to play.
Number of loops, -1 is infinite loops.
Passing one here plays the sample twice (1 loop).
Initial volume level between 0 and MIX_MAX_VOLUME
Play chunk on channel, or if channel is -1, pick the first free unreserved channel.
The vol will set initial channel volume.
The sample will play for loops+1 number of times, unless stopped by halt, or fade out, or setting a new expiration time of less time than it would have originally taken to play the loops, or closing the mixer.
Note: this just calls Mix_PlayChannelTimed()
with ticks set to -1.
Returns: the channel the sample is played on. On any errors, -1 is returned.
|
See Also:
Mix_PlayChannel,
Mix_PlayChannelTimed,
Mix_PlayChannelTimedVolume,
Mix_FadeInChannel,
Mix_FadeInChannelTimed,
Mix_FadeInChannelVolume,
Mix_FadeInChannelTimedVolume,
Mix_HaltChannel,
Mix_ExpireChannel,
Mix_ReserveChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_PlayChannelTimedVolume(int channel, Mix_Chunk *chunk,
int loops, int ticks)
Channel to play on, or -1 for the first free unreserved channel.
Sample to play.
Number of loops, -1 is infinite loops.
Passing one here plays the sample twice (1 loop).
Millisecond limit to play sample, at most.
If not enough loops or the sample chunk is not long enough, then the sample may stop before this timeout occurs.
-1 means play forever.
Initial volume level between 0 and MIX_MAX_VOLUME
If the sample is long enough and has enough loops then the sample will stop after ticks milliseconds. Otherwise this function is the same as Mix_PlayChannelVol.
Returns: the channel the sample is played on. On any errors, -1 is returned.
|
See Also:
Mix_PlayChannel,
Mix_PlayChannelVol,
Mix_FadeInChannelTimed,
Mix_FadeInChannelVolume,
Mix_FadeInChannelTimedVolume,
Mix_FadeOutChannel,
Mix_ReserveChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeInChannel(int channel, Mix_Chunk *chunk,
int loops, int ms)
Channel to play on, or -1 for the first free unreserved channel.
Sample to play.
Number of loops, -1 is infinite loops.
Passing one here plays the sample twice (1 loop).
Milliseconds of time that the fade-in effect should take to go from silence to full volume.
Play chunk on channel, or if channel is -1, pick the first free unreserved channel.
The channel volume starts at 0 and fades up to full volume over ms milliseconds of time. The sample may end before the fade-in is complete if it is too short or doesn’t have enough loops.
The sample will play for loops+1 number of times, unless stopped by halt, or fade out, or setting a new expiration time of less time than it would have originally taken to play the loops, or closing the mixer.
Note: this just calls Mix_FadeInChannelTimed()
with ticks set to -1.
Returns: the channel the sample is played on. On any errors, -1 is returned.
|
See Also:
Mix_PlayChannel,
Mix_PlayChannelVol,
Mix_PlayChannelTimedVolume,
Mix_FadeInChannelTimed,
Mix_FadeInChannelVolume,
Mix_FadeInChannelTimedVolume,
Mix_FadingChannel,
Mix_FadeOutChannel,
Mix_ReserveChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks) |
Channel to play on, or -1 for the first free unreserved channel.
Sample to play.
Number of loops, -1 is infinite loops.
Passing one here plays the sample twice (1 loop).
Milliseconds of time that the fade-in effect should take to go from silence to full volume.
Millisecond limit to play sample, at most.
If not enough loops or the sample chunk is not long enough, then the sample may stop before this timeout occurs.
-1 means play forever.
If the sample is long enough and has enough loops then the sample will stop after ticks milliseconds. Otherwise this function is the same as Mix_FadeInChannel.
Returns: the channel the sample is played on. On any errors, -1 is returned.
|
See Also:
Mix_PlayChannelTimed,
Mix_PlayChannelVol,
Mix_PlayChannelTimedVolume,
Mix_FadeInChannel,
Mix_FadeInChannelVolume,
Mix_FadeInChannelTimedVolume,
Mix_FadingChannel,
Mix_HaltChannel,
Mix_ExpireChannel,
Mix_ReserveChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeInChannelVolume(int channel, Mix_Chunk *chunk,
int loops, int ms, int vol)
Channel to play on, or -1 for the first free unreserved channel.
Sample to play.
Number of loops, -1 is infinite loops.
Passing one here plays the sample twice (1 loop).
Milliseconds of time that the fade-in effect should take to go from silence to full volume.
Initial volume level between 0 and MIX_MAX_VOLUME
Play chunk on channel, or if channel is -1, pick the first free unreserved channel.
The channel volume starts at 0 and fades up to full volume over ms milliseconds of time. The sample may end before the fade-in is complete if it is too short or doesn’t have enough loops.
The sample will play for loops+1 number of times, unless stopped by halt, or fade out, or setting a new expiration time of less time than it would have originally taken to play the loops, or closing the mixer.
The vol will set initial channel volume.
Note: this just calls Mix_FadeInChannelTimed()
with ticks set to -1.
Returns: the channel the sample is played on. On any errors, -1 is returned.
|
See Also:
Mix_PlayChannel,
Mix_PlayChannelVol,
Mix_PlayChannelTimedVolume,
Mix_FadeInChannelTimed,
Mix_FadeInChannelTimedVolume,
Mix_FadingChannel,
Mix_FadeOutChannel,
Mix_ReserveChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeInChannelTimedVolume(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks, int vol) |
Channel to play on, or -1 for the first free unreserved channel.
Sample to play.
Number of loops, -1 is infinite loops.
Passing one here plays the sample twice (1 loop).
Milliseconds of time that the fade-in effect should take to go from silence to full volume.
Millisecond limit to play sample, at most.
If not enough loops or the sample chunk is not long enough, then the sample may stop before this timeout occurs.
-1 means play forever.
Initial volume level between 0 and MIX_MAX_VOLUME
If the sample is long enough and has enough loops then the sample will stop after ticks milliseconds. Otherwise this function is the same as Mix_FadeInChannelVolume.
Returns: the channel the sample is played on. On any errors, -1 is returned.
|
See Also:
Mix_PlayChannelTimed,
Mix_PlayChannelVol,
Mix_PlayChannelTimedVolume,
Mix_FadeInChannel,
Mix_FadeInChannelTimed,
Mix_FadeInChannelVolume,
Mix_FadingChannel,
Mix_HaltChannel,
Mix_ExpireChannel,
Mix_ReserveChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_Pause(int channel)
Channel to pause on, or -1 for all channels.
Pause channel, or all playing channels if -1 is passed in. You may still halt a paused channel.
Note: Only channels which are actively playing will be paused.
|
See Also:
Mix_Resume,
Mix_Paused,
Mix_HaltChannel
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_Resume(int channel)
Channel to resume playing, or -1 for all channels.
Unpause channel, or all playing and paused channels if -1 is passed in.
|
See Also:
Mix_Pause,
Mix_Paused
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_HaltChannel(int channel)
Channel to stop playing, or -1 for all channels.
Halt channel playback, or all channels if -1 is passed in.
Any callback set by Mix_ChannelFinished
will be called.
Returns: always returns zero. (kinda silly)
|
See Also:
Mix_ExpireChannel,
Mix_FadeOutChannel,
Mix_ChannelFinished
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ExpireChannel(int channel, int ticks)
Channel to stop playing, or -1 for all channels.
Millisecons until channel(s) halt playback.
Halt channel playback, or all channels if -1 is passed in, after ticks milliseconds.
Any callback set by Mix_ChannelFinished
will be called when the channel expires.
Returns: Number of channels set to expire. Whether or not they are active.
|
See Also:
Mix_HaltChannel,
Mix_FadeOutChannel,
Mix_ChannelFinished
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeOutChannel(int channel, int ms)
Channel to fade out, or -1 to fade all channels out.
Milliseconds of time that the fade-out effect should take to go to silence, starting now.
Gradually fade out which channel over ms milliseconds starting from now.
The channel will be halted after the fade out is completed. Only channels that are playing are set to fade out, including paused channels.
Any callback set by Mix_ChannelFinished
will be called when the channel finishes fading out.
Returns: The number of channels set to fade out.
|
See Also:
Mix_FadeInChannel,
Mix_FadeInChannelTimed,
Mix_FadingChannel,
Mix_ChannelFinished
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ChannelFinished(void (*channel_finished)(int channel))
Function to call when any channel finishes playback.
When channel playback is halted, then the specified channel_finished function is called. The channel
parameter will contain the channel number that has finished.
NOTE: NEVER call SDL_Mixer functions, nor SDL_LockAudio
, from a callback function.
|
|
See Also:
Mix_HaltChannel,
Mix_ExpireChannel
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_Playing(int channel)
Channel to test whether it is playing or not.
-1 will tell you how many channels are playing.
Tells you if channel is playing, or not.
Note: Does not check if the channel has been paused.
Returns: Zero if the channel is not playing. Otherwise if you passed in -1, the number of channels playing is returned. If you passed in a specific channel, then 1 is returned if it is playing.
|
See Also:
Mix_Paused,
Mix_Fading,
Mix_PlayChannel,
Mix_Pause,
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_Paused(int channel)
Channel to test whether it is paused or not.
-1 will tell you how many channels are paused.
Tells you if channel is paused, or not.
Note: Does not check if the channel has been halted after it was paused, which may seem a little weird.
Returns: Zero if the channel is not paused. Otherwise if you passed in -1, the number of paused channels is returned. If you passed in a specific channel, then 1 is returned if it is paused.
|
See Also:
Mix_Playing,
Mix_Pause,
Mix_Resume
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Fading Mix_FadingChannel(int which)
Channel to get the fade activity status from.
-1 is not valid, and will probably crash the program.
Tells you if which channel is fading in, out, or not. Does not tell you if the channel is playing anything, or paused, so you’d need to test that separately.
Returns: the fading status. Never returns an error.
|
See Also:
Mix_Fading,
Mix_Playing,
Mix_Paused,
Mix_FadeInChannel,
Mix_FadeInChannelTimed,
Mix_FadeOutChannel
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Chunk *Mix_GetChunk(int channel)
Channel to get the current Mix_Chunk playing.
-1 is not valid, but will not crash the program.
Get the most recent sample chunk pointer played on channel. This pointer may be currently playing, or just the last used.
Note: The actual chunk may have been freed, so this pointer may not be valid anymore.
Returns: Pointer to the Mix_Chunk. NULL is returned if the channel is not allocated, or if the channel has not played any samples yet.
|
See Also:
Mix_Chunk,
Mix_Playing
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions work with groupings of mixer channels.
The default group tag number of -1, which refers to ALL channels.
Setup | ||
---|---|---|
5.4.1 Mix_ReserveChannels | Prevent channels from being used in default group | |
TODO | ||
5.4.2 Mix_GroupChannel | Add/remove channel to/from group | |
5.4.3 Mix_GroupChannels | Add/remove segment of channels to/from group | |
Info | ||
5.4.4 Mix_GroupCount | Get number of channels in group | |
5.4.5 Mix_GroupAvailable | Get first inactive channel in group | |
5.4.6 Mix_GroupOldest | Get oldest busy channel in group | |
5.4.7 Mix_GroupNewer | Get youngest busy channel in group | |
Stopping | ||
5.4.8 Mix_FadeOutGroup | Fade out a group over time | |
5.4.9 Mix_HaltGroup | Stop a group |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ReserveChannels(int num)
Number of channels to reserve from default mixing.
Zero removes all reservations.
Reserve num channels from being used when playing samples when passing in -1 as a channel number to playback functions. The channels are reserved starting from channel 0 to num-1. Passing in zero will unreserve all channels. Normally SDL_mixer starts without any channels reserved.
The following functions are affected by this setting:
Mix_PlayChannel
Mix_PlayChannelTimed
Mix_FadeInChannel
Mix_FadeInChannelTimed
Returns: The number of channels reserved. Never fails, but may return less channels than you ask for, depending on the number of channels previously allocated.
|
See Also:
Mix_AllocateChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GroupChannel(int which, int tag)
Channel number of channels to assign tag to.
A group number Any positive numbers (including zero).
-1 is the default group. Use -1 to remove a group tag essentially.
Add which channel to group tag, or reset it’s group to the default group tag (-1).
Returns: True(1) on success. False(0) is returned when the channel specified is invalid.
|
See Also:
Mix_GroupChannels,
Mix_AllocateChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GroupChannels(int from, int to, int tag)
First Channel number of channels to assign tag to. Must be less or equal to to.
Last Channel number of channels to assign tag to. Must be greater or equal to from.
A group number. Any positive numbers (including zero).
-1 is the default group. Use -1 to remove a group tag essentially.
Add channels starting at from up through to to group tag, or reset it’s group to the default group tag (-1).
Returns: The number of tagged channels on success. If that number is less than to-from+1 then some channels were no tagged because they didn’t exist.
|
See Also:
Mix_GroupChannel,
Mix_AllocateChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GroupCount(int tag)
A group number Any positive numbers (including zero).
-1 will count ALL channels.
Count the number of channels in group tag.
Returns: The number of channels found in the group. This function never fails.
|
See Also:
Mix_GroupChannel,
Mix_GroupChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GroupAvailable(int tag)
A group number Any positive numbers (including zero).
-1 will search ALL channels.
Find the first available (not playing) channel in group tag.
Returns: The channel found on success. -1 is returned when no channels in the group are available.
|
See Also:
Mix_GroupOldest,
Mix_GroupNewer,
Mix_GroupChannel,
Mix_GroupChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GroupOldest(int tag)
A group number Any positive numbers (including zero).
-1 will search ALL channels.
Find the oldest actively playing channel in group tag.
Returns: The channel found on success. -1 is returned when no channels in the group are playing or the group is empty.
|
See Also:
Mix_GroupNewer,
Mix_GroupAvailable,
Mix_GroupChannel,
Mix_GroupChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GroupNewer(int tag)
A group number Any positive numbers (including zero).
-1 will search ALL channels.
Find the newest, most recently started, actively playing channel in group tag.
Returns: The channel found on success. -1 is returned when no channels in the group are playing or the group is empty.
|
See Also:
Mix_GroupOldest,
Mix_GroupAvailable,
Mix_GroupChannel,
Mix_GroupChannels
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeOutGroup(int tag, int ms)
Group to fade out.
NOTE: -1 will NOT fade all channels out. Use Mix_FadeOutChannel(-1)
for that instead.
Milliseconds of time that the fade-out effect should take to go to silence, starting now.
Gradually fade out channels in group tag over ms milliseconds starting from now.
The channels will be halted after the fade out is completed. Only channels that are playing are set to fade out, including paused channels.
Any callback set by Mix_ChannelFinished
will be called when each channel finishes fading out.
Returns: The number of channels set to fade out.
|
See Also:
Mix_HaltGroup,
Mix_FadeOutChannel,
Mix_FadingChannel,
Mix_ChannelFinished
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_HaltGroup(int tag)
Group to fade out.
NOTE: -1 will NOT halt all channels. Use Mix_HaltChannel(-1)
for that instead.
Halt playback on all channels in group tag.
Any callback set by Mix_ChannelFinished
will be called once for each channel that stops.
Returns: always returns zero. (more silly than Mix_HaltChannel)
|
See Also:
Mix_FadeOutGroup,
Mix_HaltChannel,
Mix_ChannelFinished
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions work with music. Music is not played on a normal mixer channel.
Music is therefore manipulated separately, except in post-processing hooks.
There are two different music sub-systems provided:
- single-music: the old API of the SDL_mixer. The most of given calls don’t even has the Mix_Music argument and intended to manipulate the currently playing music.
- multi-music: the new API of the MixerX. Every given call intended to work with the multi-music has the Mix_Music argument to manipulate every music individually as they are able to work in parallel.
Loading | ||
---|---|---|
5.5.1 Mix_GetNumMusicDecoders | Number of music format types that can be decoded | |
5.5.2 Mix_GetMusicDecoder | Name of enumerated music format type decoder | |
5.5.3 Mix_HasMusicDecoder | Check if the specific music decoder is abailable by name in this build | |
5.5.4 Mix_LoadMUS | Load a music file into a Mix_Music | |
5.5.5 Mix_LoadMUS_RW | Load Music through SDL RWops | |
5.5.6 Mix_LoadMUS_RW_ARG | Load music through SDL RWops with passing of extra arguments string [Mixer X] | |
5.5.7 Mix_LoadMUS_RW_GME | Load music through SDL RWops with passing of GME track number [Mixer X] | |
5.5.8 Mix_LoadMUSType_RW | Load a music file from an SDL RWops object assuming a specific format | |
5.5.9 Mix_LoadMUSType_RW_ARG | Load a music file from an SDL RWops object assuming a specific format with passing of extra Music Arguments string [Mixer X] | |
Free | ||
5.5.10 Mix_FreeMusic | Free a Mix_Music | |
5.5.11 Mix_SetFreeOnStop | Mark a Mix_Music to be free automatically when it get halted. [Mixer X] | |
Playing | ||
5.5.12 Mix_PlayMusicStream | Play music, with looping [Mixer X] | |
5.5.13 Mix_FadeInMusicStream | Play music, with looping, and fade in [Mixer X] | |
5.5.14 Mix_FadeInMusicStreamPos | Play music from a start point, with looping, and fade in [Mixer X] | |
5.5.15 Mix_CrossFadeMusicStream | Cross-fade from old music into new (fade-out old and fade-in a new at the same time) [Mixer X] | |
5.5.16 Mix_CrossFadeMusicStreamPos | Cross-fade from old music into new from a start point (fade-out old and fade-in a new at the same time) [Mixer X] | |
5.5.17 Mix_HookMusic | Hook for a custom music player | |
Playing (legacy single-stream) | ||
5.5.18 Mix_PlayMusic | Play single-stream music, with looping | |
5.5.19 Mix_FadeInMusic | Play single-stream music, with looping, and fade in | |
5.5.20 Mix_FadeInMusicPos | Play single-stream music from a start point, with looping, and fade in | |
Settings | ||
5.5.21 Mix_VolumeMusicStream | Set the individual music volume [Mixer X] | |
5.5.22 Mix_GetMusicVolume | Get the individual music volume [Mixer 2.0] | |
5.5.23 Mix_GetVolumeMusicStream | Get the individual music volume, alias to Mix_GetMusicVolume [Mixer X] | |
5.5.24 Mix_VolumeMusicGeneral | Set the general music volume [Mixer X] | |
5.5.25 Mix_GetVolumeMusicGeneral | Get the general music volume [Mixer X] | |
5.5.26 Mix_PauseMusicStream | Pause music [Mixer X] | |
5.5.27 Mix_PauseMusicStreamAll | Pause all music (except the single-stream music) [Mixer X] | |
5.5.28 Mix_ResumeMusicStream | Resume music [Mixer X] | |
5.5.29 Mix_ResumeMusicStreamAll | Resume all music (except the single-stream music) [Mixer X] | |
5.5.30 Mix_RewindMusicStream | Rewind music to beginning [Mixer X] | |
5.5.31 Mix_SetMusicPositionStream | Set position of playback in music [Mixer X] | |
5.5.32 Mix_GetMusicPosition | Get the time current position of music stream [Mixer X] | |
5.5.33 Mix_ModMusicStreamJumpToOrder | Jump to a given order in mod music. Only for MOD music formats. [Mixer X] | |
5.5.34 Mix_StartTrack | Select a song contained in the music file to play. | |
5.5.35 Mix_GetNumTracks | Get count of the songs contained inside a music file. | |
5.5.36 Mix_MusicDuration | Get the total time length of music stream [Mixer X] | |
5.5.37 Mix_GetMusicLoopStartTime | Get the loop start time position of music stream [Mixer X] | |
5.5.38 Mix_GetMusicLoopEndTime | Get the loop end time position of music stream [Mixer X] | |
5.5.39 Mix_GetMusicLoopLengthTime | Get the loop time length of music stream [Mixer X] | |
5.5.40 Mix_SetMusicTempo | Set the music tempo factor [Mixer X] | |
5.5.41 Mix_GetMusicTempo | Get the music tempo [Mixer X] | |
5.5.42 Mix_SetMusicSpeed | Set the music tempo factor [Mixer X] | |
5.5.43 Mix_GetMusicSpeed | Get the music tempo [Mixer X] | |
5.5.44 Mix_SetMusicPitch | Set the music tempo factor [Mixer X] | |
5.5.45 Mix_GetMusicPitch | Get the music tempo [Mixer X] | |
5.5.46 Mix_GetMusicTracks | Get the number of tracks (or channels) at the MIDI/Tracker/Chiptune music [Mixer X] | |
5.5.47 Mix_SetMusicTrackMute | Mute or unmute the given track (or channel) at the MIDI/Tracker/Chiptune music [Mixer X] | |
5.5.48 Mix_SetMusicCMD | Use external program for music playback | |
5.5.49 Mix_GetSynchroValue | makes no effect yet. Get the module music synchro value [Mixer 2.0] | |
5.5.50 Mix_SetSynchroValue | makes no effect yet. Set the synchro value for module music [Mixer 2.0] | |
5.5.51 Mix_SetMusicFileName | Change the reporting filename tag of a music [Mixer X] | |
Settings (legacy single-stream) | ||
5.5.52 Mix_VolumeMusic | Set single-stream music volume | |
5.5.53 Mix_PauseMusic | Pause single-stream music | |
5.5.54 Mix_ResumeMusic | Resume paused single-stream music | |
5.5.55 Mix_RewindMusic | Rewind single-stream music to beginning | |
5.5.56 Mix_SetMusicPosition | Set position of playback in stream | |
5.5.57 Mix_ModMusicJumpToOrder | Jump to a given order in mod single-stream music. Only for MOD music formats. [Mixer 2.0] | |
MIDI settings | ||
5.5.58 Mix_GetMidiPlayer | Get type of MIDI player library currently in use [Mixer X] | |
5.5.59 Mix_GetNextMidiPlayer | Get type of MIDI player library prepared for next opening of MIDI file [Mixer X] | |
5.5.60 Mix_SetMidiPlayer | Set a MIDI player library to play MIDI music [Mixer X] | |
5.5.61 Mix_SetLockMIDIArgs | Enable ignoring of MIDI arguments and locking of current MIDI setup [Mixer X] | |
Stopping | ||
5.5.62 Mix_HaltMusicStream | Stop music playback [Mixer X] | |
5.5.63 Mix_FadeOutMusicStream | Stop music, with fade out [Mixer X] | |
5.5.64 Mix_HookMusicStreamFinished | Set a callback for when exact music stops [Mixer X] | |
5.5.65 Mix_HookMusicStreamFinishedAny | Set a callback for when any music stops [Mixer X] | |
Stopping (legacy single-stream) | ||
5.5.66 Mix_HaltMusic | Stop single-stream music playback | |
5.5.67 Mix_FadeOutMusic | Stop single-stream music, with fade out | |
5.5.68 Mix_HookMusicFinished | Set a callback for when single-stream music stops | |
Info | ||
5.5.69 Mix_GetMusicType | Get the music encoding type | |
5.5.70 Mix_PlayingMusicStream | Test whether music is playing [Mixer X] | |
5.5.71 Mix_PausedMusicStream | Test whether music is paused [Mixer X] | |
5.5.72 Mix_FadingMusicStream | Get status of current music fade activity [Mixer X] | |
5.5.73 Mix_GetMusicHookData | Retrieve the Mix_HookMusic arg | |
Info (legacy single-stream) | ||
5.5.74 Mix_PlayingMusic | Test whether single-stream music is playing | |
5.5.75 Mix_PausedMusic | Test whether single-stream music is paused | |
5.5.76 Mix_FadingMusic | Get status of current single-stream music fade activity | |
Meta-Tags | ||
5.5.77 Mix_GetMusicTitle | Retrieve the title meta-tag of currently playing music [Mixer X] | |
5.5.78 Mix_GetMusicTitleTag | Retrieve the title meta-tag of currently playing music [Mixer X] | |
5.5.79 Mix_GetMusicArtistTag | Retrieve the artist meta-tag of currently playing music [Mixer X] | |
5.5.80 Mix_GetMusicAlbumTag | Retrieve the album meta-tag of currently playing music [Mixer X] | |
5.5.81 Mix_GetMusicCopyrightTag | Retrieve the copyright meta-tag of currently playing music [Mixer X] | |
Timidity Extra Settings | ||
5.5.82 Mix_SetTimidityCfg | Set the custom Timidity config path [Mixer X] | |
5.5.83 Mix_GetTimidityCfg | Get the current Timidity config path [Mixer X] | |
Game Music EMU Extra Settings | ||
5.5.84 Mix_GME_SetSpcEchoDisabled | Set the "SPC echo disabled" playing parameter [Mixer X] | |
5.5.85 Mix_GME_GetSpcEchoDisabled | Get the current value of the "SPC echo disabled" playing parameter [Mixer X] | |
FluidSynth Extra Settings | ||
5.5.86 Mix_SetSoundFonts | Set global SoundFonts paths to use by supported FluidSynth MIDI backend [Mixer 2.0] | |
5.5.87 Mix_GetSoundFonts | Get global SoundFonts paths to use by supported FluidSynth MIDI backend [Mixer 2.0] | |
5.5.88 Mix_EachSoundFont | Iterate global SoundFonts paths to use by supported FluidSynth MIDI backend [Mixer 2.0] | |
5.5.89 Mix_EachSoundFontEx | Iterate global SoundFonts paths and additionally with given custom paths to use by supported FluidSynth MIDI backend [Mixer X] | |
libADLMIDI Extra Settings | ||
5.5.90 Mix_ADLMIDI_getTotalBanks | Get total count of available embedded banks [Mixer X] | |
5.5.91 Mix_ADLMIDI_getBankNames | Get array of embedded bank titles [Mixer X] | |
5.5.92 Mix_ADLMIDI_getBankID | Get ID of currently set bank [Mixer X] | |
5.5.93 Mix_ADLMIDI_setBankID | Change current bank. Applying on MIDI file reopen. [Mixer X] | |
5.5.94 Mix_ADLMIDI_getTremolo | Get current state of "Deep Tremolo" OPL3 flag [Mixer X] | |
5.5.95 Mix_ADLMIDI_setTremolo | Set state of "Deep Tremolo" OPL3 flag. Applying on MIDI file reopen. [Mixer X] | |
5.5.96 Mix_ADLMIDI_getVibrato | Get current state of "Deep Vibrato" OPL3 flag [Mixer X] | |
5.5.97 Mix_ADLMIDI_setVibrato | Set state of "Deep Vibrato" OPL3 flag. Applying on MIDI file reopen. [Mixer X] | |
5.5.98 Mix_ADLMIDI_getScaleMod | Get current state of "Scalable modulation mode" flag [Mixer X] | |
5.5.99 Mix_ADLMIDI_setScaleMod | Turn on/off scalable modulation mode flag. Applying on MIDI file reopen. [Mixer X] | |
5.5.100 Mix_ADLMIDI_getVolumeModel | Get ID of current volumes model [Mixer X] | |
5.5.101 Mix_ADLMIDI_setVolumeModel | Change current volume model. Applying on MIDI file reopen. [Mixer X] | |
5.5.102 Mix_ADLMIDI_getFullRangeBrightness | Get full range mode for CC74-Brightness controller [Mixer X] | |
5.5.103 Mix_ADLMIDI_setFullRangeBrightness | Set full range mode for CC74-Brightness controller [Mixer X] | |
5.5.104 Mix_ADLMIDI_getAutoArpeggio | Get the automatic arpeggio enable/disable setting state [Mixer X] | |
5.5.105 Mix_ADLMIDI_setAutoArpeggio | Get the automatic arpeggio enable/disable setting state [Mixer X] | |
5.5.106 Mix_ADLMIDI_getFullPanStereo | Get full panning stereo mode [Mixer X] | |
5.5.107 Mix_ADLMIDI_setFullPanStereo | Set full panning stereo mode [Mixer X] | |
5.5.108 Mix_ADLMIDI_getEmulator | Get the OPL3 Emulator for ADLMIDI [Mixer X] | |
5.5.109 Mix_ADLMIDI_setEmulator | Select the OPL3 Emulator for ADLMIDI [Mixer X] | |
5.5.110 Mix_ADLMIDI_getChipsCount | Get the number of parallel emulated OPL3 chips to get the available polyphony range [Mixer X] | |
5.5.111 Mix_ADLMIDI_setChipsCount | Set the number of parallel emulated OPL3 chips to define the available polyphony range [Mixer X] | |
5.5.112 Mix_ADLMIDI_setSetDefaults | Reset ADLMIDI settings to default state. Applying on MIDI file reopen. [Mixer X] | |
5.5.113 Mix_ADLMIDI_setCustomBankFile | Path to custom WOPL bank file. Applying on MIDI file reopen. [Mixer X] | |
libOPNMIDI Extra Settings | ||
5.5.114 Mix_OPNMIDI_getVolumeModel | Get ID of current volumes model [Mixer X] | |
5.5.115 Mix_OPNMIDI_setVolumeModel | Change current volume model. Applying on MIDI file reopen. [Mixer X] | |
5.5.116 Mix_OPNMIDI_getFullRangeBrightness | Get full range mode for CC74-Brightness controller [Mixer X] | |
5.5.117 Mix_OPNMIDI_setFullRangeBrightness | Set full range mode for CC74-Brightness controller [Mixer X] | |
5.5.118 Mix_OPNMIDI_getAutoArpeggio | Get the automatic arpeggio enable/disable setting state [Mixer X] | |
5.5.119 Mix_OPNMIDI_setAutoArpeggio | Get the automatic arpeggio enable/disable setting state [Mixer X] | |
5.5.120 Mix_OPNMIDI_getFullPanStereo | Get full panning stereo mode [Mixer X] | |
5.5.121 Mix_OPNMIDI_setFullPanStereo | Set full panning stereo mode [Mixer X] | |
5.5.122 Mix_OPNMIDI_getEmulator | Get the OPN2/OPNA Emulator for OPNMIDI [Mixer X] | |
5.5.123 Mix_OPNMIDI_setEmulator | Select the OPN2/OPNA Emulator for OPNMIDI [Mixer X] | |
5.5.124 Mix_OPNMIDI_getChipsCount | Get the number of parallel emulated OPN2/OPNA chips to get the available polyphony range [Mixer X] | |
5.5.125 Mix_OPNMIDI_setChipsCount | Set the number of parallel emulated OPN2/OPNA chips to define the available polyphony range [Mixer X] | |
5.5.126 Mix_OPNMIDI_setSetDefaults | Reset OPNMIDI settings to default state. Applying on MIDI file reopen. [Mixer X] | |
5.5.127 Mix_OPNMIDI_setCustomBankFile | Path to custom WOPN bank file. Applying on MIDI file reopen. [Mixer X] | |
Extra | ||
5.5.128 Music Arguments | The special arguments string that can be passed together with the music file path to set up individual music settings.[Mixer X] | |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetNumMusicDecoders()
Get the number of music decoders available from the Mix_GetMusicDecoder
function. This number can be different for each run of a program, due to the change in availability of shared libraries that support each format.
Returns: The number of music decoders available.
|
See Also:
Mix_GetNumChunkDecoders,
Mix_GetMusicDecoder,
Mix_LoadMUS
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_GetMusicDecoder(int index)
The index number of music decoder to get.
In the range from 0(zero) to Mix_GetNumMusicDecoders()-1, inclusive.
Get the name of the indexed music decoder.
You need to get the number of music decoders available using the Mix_GetNumMusicDecoders
function.
Returns: The name of the indexed music decoder. This string is owned by the SDL_mixer library, do not modify or free it. It is valid until you call Mix_CloseAudio
the final time.
|
See Also:
Mix_GetNumMusicDecoders,
Mix_GetChunkDecoder,
Mix_LoadWAV
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
SDL_bool Mix_HasMusicDecoder(const char *name)
The decoder name to check it’s presence.
Check if the music decoder named as name presented in this library build.
Returns: SDL_TRUE
if the requested codec name is available in this library build or SDL_FALSE
if not.
See Also:
Mix_Music,
Mix_SetMusicCMD,
Mix_PlayMusic,
Mix_FadeInMusic,
Mix_FadeInMusicPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Music *Mix_LoadMUS(const char *file)
Name of music file to use. You may add the Music Arguments after the filepath using the | symbol as the separator.
Load music file to use. This can load WAVE, MOD, MIDI, OGG, MP3, FLAC, and any file that you use a command to play with.
If you are using an external command to play the music, you must call Mix_SetMusicCMD
before this, otherwise the internal players will be used. Alternatively, if you have set an external command up and don’t want to use it, you must call Mix_SetMusicCMD(NULL)
to use the built-in players again.
Returns: A pointer to a Mix_Music. NULL is returned on errors.
|
See Also:
Mix_Music,
Mix_SetMusicCMD,
Mix_PlayMusic,
Mix_FadeInMusic,
Mix_FadeInMusicPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Music *Mix_LoadMUS_RW(SDL_RWops *src, int freesrc)
SDL RWops instance of music file / memory
Automatically close SDL_RWops instance on complete loading of music
Load a music file from an SDL_RWop object
Returns: A pointer to a Mix_Music. NULL is returned on errors.
|
See Also:
Mix_Music,
Mix_LoadMUS_RW_ARG,
Mix_LoadMUS_RW_GME,
Mix_LoadMUSType_RW,
Mix_LoadMUSType_RW_ARG,
Mix_SetMusicCMD,
Mix_PlayMusic,
Mix_FadeInMusic,
Mix_FadeInMusicPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Music *Mix_LoadMUS_RW_ARG(SDL_RWops *src, int freesrc, const char *args)
SDL RWops instance of music file / memory
Automatically close SDL_RWops instance on complete loading of music
The Music Arguments string supported by specific library
Load a music file from an SDL_RWop object with custom arguments
Returns: A pointer to a Mix_Music. NULL is returned on errors.
|
See Also:
Mix_Music,
Mix_LoadMUS_RW,
Mix_LoadMUS_RW_GME,
Mix_LoadMUSType_RW,
Mix_LoadMUSType_RW_ARG,
Mix_SetMusicCMD,
Mix_PlayMusic,
Mix_FadeInMusic,
Mix_FadeInMusicPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Music *Mix_LoadMUS_RW_GME(SDL_RWops *src, int freesrc, int trackID)
SDL RWops instance of music file / memory
Automatically close SDL_RWops instance on complete loading of music
ID of GME file track
Load music file to use.
Returns: A pointer to a Mix_Music. NULL is returned on errors.
|
See Also:
Mix_Music,
Mix_LoadMUS_RW,
Mix_LoadMUS_RW_ARG,
Mix_LoadMUSType_RW,
Mix_LoadMUSType_RW_ARG,
Mix_SetMusicCMD,
Mix_PlayMusic,
Mix_FadeInMusic,
Mix_FadeInMusicPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Music *Mix_LoadMUSType_RW(SDL_RWops *src, Mix_MusicType type, int freesrc)
SDL RWops instance of music file / memory
A music type identificator
Automatically close SDL_RWops instance on complete loading of music
Load a music file from an SDL_RWop object assuming a specific format
Returns: A pointer to a Mix_Music. NULL is returned on errors.
|
See Also:
Mix_Music,
Mix_LoadMUS_RW,
Mix_LoadMUS_RW_GME,
Mix_LoadMUSType_RW_ARG,
Mix_SetMusicCMD,
Mix_PlayMusic,
Mix_FadeInMusic,
Mix_FadeInMusicPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Music *Mix_LoadMUSType_RW_ARG(SDL_RWops *src, Mix_MusicType type, int freesrc)
SDL RWops instance of music file / memory
A music type identificator
Automatically close SDL_RWops instance on complete loading of music
The Music Arguments string supported by specific library
Load a music file from an SDL_RWop object assuming a specific format with custom arguments (trackID for GME or settings for a MIDI playing)
Returns: A pointer to a Mix_Music. NULL is returned on errors.
|
See Also:
Mix_Music,
Mix_LoadMUS_RW,
Mix_LoadMUS_RW_GME,
Mix_LoadMUSType_RW,
Mix_SetMusicCMD,
Mix_PlayMusic,
Mix_FadeInMusic,
Mix_FadeInMusicPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_FreeMusic(Mix_Music *music)
Pointer to Mix_Music to free.
Free the loaded music. If music is playing it will be halted. If music is fading out, then this function will wait (blocking) until the fade out is complete.
|
See Also:
Mix_LoadMUS
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_FreeMusic(Mix_Music *music, int free_on_stop)
Pointer to Mix_Music to free.
1 - make music to be free automatically when it finishes the playback, 0 - cancel the automatical free.
Mark the loaded music to be free automatically when it get halted.
Can be used to simplify the dynamic stream processing when you want
to automatically free the music once it get halted.
Note: Music will NOT be free when you stop it manually using the Mix_HaltMusicStream call.
However, it will get free automatically when you will use the Mix_FadeOutMusicStream call
with a non-zero ms delay.
Supported by multi-stream music sub-system only.
|
See Also:
Mix_LoadMUS
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_PlayMusicStream(Mix_Music *music, int loops)
Pointer to Mix_Music to play.
number of times to play through the music.
0 plays the music zero times...
-1 plays the music forever (or as close as it can get to that)
Play the loaded music loop times through from start to finish.
The previous music will continue play or fade concurrently.
You can use this function to play multiple parallel music files
(or long atmosphere sound effects).
CAUTION: You can’t use this function with MIDI played through Native MIDI
interface: this interface doesn’t support parallel playing of multiple music files.
Please use the Mix_PlayMusic function to playNativeMidi as a single-stream
music.
Returns: 0 on success, or -1 on errors.
|
See Also:
Mix_FadeInMusicStream
Mix_CrossFadeMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeInMusicStream(Mix_Music *music, int loops, int ms)
Pointer to Mix_Music to play.
number of times to play through the music.
0 plays the music zero times...
-1 plays the music forever (or as close as it can get to that)
Milliseconds for the fade-in effect to complete.
Fade in over ms milliseconds of time, the loaded music, playing
it loop times through from start to finish.
The fade in effect only applies to the first loop.
Any previous music will continue play or fade concurrently.
You can use this function to play multiple parallel music files
(or long atmosphere sound effects).
This function is the same as Mix_FadeInMusicStreamPos(music, loops, ms, 0)
.
CAUTION: You can’t use this function with MIDI played through Native MIDI
interface: this interface doesn’t support parallel playing of multiple music files.
Please use the Mix_FadeInMusic function to play NativeMidi as a single-stream
music.
Returns: 0 on success, or -1 on errors.
|
See Also:
Mix_PlayMusicStream,
Mix_FadeInMusicStreamPos
Mix_CrossFadeMusicStream
Mix_CrossFadeMusicStreamPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeInMusicStreamPos(Mix_Music *music, int loops, int ms, double position)
Pointer to Mix_Music to play.
number of times to play through the music.
0 plays the music zero times...
-1 plays the music forever (or as close as it can get to that)
Milliseconds for the fade-in effect to complete.
Position to play from, see Mix_SetMusicPositionStream
for meaning.
Fade in over ms milliseconds of time, the loaded music, playing it loop times through from start to finish.
The fade in effect only applies to the first loop.
The first time the music is played, it position will be set to position, which means different things for different types of music files, see Mix_SetMusicPosition
for more info on that.
Any previous music will continue play or fade concurrently.
You can use this function to play multiple parallel music files
(or long atmosphere sound effects).
CAUTION: You can’t use this function with MIDI played through Native MIDI
interface: this interface doesn’t support parallel playing of multiple music files.
Please use the Mix_FadeInMusicPos function to play NativeMidi as a single-stream
music.
Returns: 0 on success, or -1 on errors.
|
See Also:
Mix_PlayMusicStream,
Mix_FadeInMusicStream,
Mix_SetMusicPosition
Mix_CrossFadeMusicStream
Mix_CrossFadeMusicStreamPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_CrossFadeMusicStream(Mix_Music *old_music, Mix_Music *new_music, int loops, int ms, int free_old)
Pointer to old playing Mix_Music to stop with the fade out effect.
Pointer to new Mix_Music to play with the fade in effect.
number of times to play through the music.
0 plays the music zero times...
-1 plays the music forever (or as close as it can get to that)
Milliseconds for the fade-in effect to complete.
Automatically free the old music after it will complete the fade out.
0 keeps the old music untouched.
1 music will be deleted after it will complete the fade out.
Fade in over ms milliseconds of time, the loaded new_music, playing it loop times through from start to finish.
Fade out the old_music at the same time as fade in the new_music.
The fade in effect only applies to the first loop.
Any previous music will continue play or fade concurrently.
This function is the same as Mix_CrossFadeMusicStreamPos(old_music, new_music, loops, ms, 0, 0)
.
CAUTION: You can’t use this function with MIDI played through Native MIDI
interface: this interface doesn’t support parallel playing of multiple music files.
Returns: 0 on success, or -1 on errors.
|
See Also:
Mix_PlayMusicStream,
Mix_CrossFadeMusicStreamPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_CrossFadeMusicStreamPos(Mix_Music *old_music, Mix_Music *new_music, int loops, int ms, double position, int free_old)
Pointer to old playing Mix_Music to stop with the fade out effect.
Pointer to new Mix_Music to play with the fade in effect.
number of times to play through the music.
0 plays the music zero times...
-1 plays the music forever (or as close as it can get to that)
Milliseconds for the fade-in effect to complete.
Position to play from, see Mix_SetMusicPositionStream
for meaning.
Automatically free the old music after it will complete the fade out.
0 keeps the old music untouched.
1 music will be deleted after it will complete the fade out.
Fade in over ms milliseconds of time, the loaded music, playing it loop times through from start to finish.
Fade out the old_music at the same time as fade in the new_music.
The fade in effect only applies to the first loop.
The first time the music is played, it position will be set to position, which means different things for different types of music files, see Mix_SetMusicPosition
for more info on that.
Any previous music will continue play or fade concurrently.
CAUTION: You can’t use this function with MIDI played through Native MIDI
interface: this interface doesn’t support parallel playing of multiple music files.
Returns: 0 on success, or -1 on errors.
|
See Also:
Mix_PlayMusicStream,
Mix_CrossFadeMusicStream,
Mix_SetMusicPosition
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_HookMusic(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg) |
Function pointer to a music player mixer function.
NULL will stop the use of the music player, returning the mixer to using the internal music players like usual.
This is passed to the mix_func’s udata
parameter when it is called.
This sets up a custom music player function. The function will be called with arg passed into the udata
parameter when the mix_func is called. The stream
parameter passes in the audio stream buffer to be filled with len
bytes of music. The music player will then be called automatically when the mixer needs it. Music playing will start as soon as this is called. All the music playing and stopping functions have no effect on music after this. Pause and resume will work. Using a custom music player and the internal music player is not possible, the custom music player takes priority. To stop the custom music player call Mix_HookMusic(NULL, NULL)
.
NOTE: NEVER call SDL_Mixer functions, nor SDL_LockAudio
, from a callback function.
|
See Also:
Mix_SetMusicCMD,
Mix_GetMusicHookData
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_PlayMusic(Mix_Music *music, int loops)
Pointer to Mix_Music to play.
number of times to play through the music.
0 plays the music zero times...
-1 plays the music forever (or as close as it can get to that)
Play the loaded music loop times through from start to finish. The previous music will be halted, or if fading out it waits (blocking) for that to finish.
Please use the Mix_PlayMusicStream function to play multiple music streams in parallel.
Returns: 0 on success, or -1 on errors.
|
See Also:
Mix_FadeInMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeInMusic(Mix_Music *music, int loops, int ms)
Pointer to Mix_Music to play.
number of times to play through the music.
0 plays the music zero times...
-1 plays the music forever (or as close as it can get to that)
Milliseconds for the fade-in effect to complete.
Fade in over ms milliseconds of time, the loaded music, playing it loop times through from start to finish.
The fade in effect only applies to the first loop.
Any previous music will be halted, or if it is fading out it will wait (blocking) for the fade to complete.
This function is the same as Mix_FadeInMusicPos(music, loops, ms, 0)
.
Please use the Mix_FadeInMusicStream function to play multiple music streams in parallel.
Returns: 0 on success, or -1 on errors.
|
See Also:
Mix_PlayMusic,
Mix_FadeInMusicPos
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position)
Pointer to Mix_Music to play.
number of times to play through the music.
0 plays the music zero times...
-1 plays the music forever (or as close as it can get to that)
Milliseconds for the fade-in effect to complete.
Position to play from, see Mix_SetMusicPosition
for meaning.
Fade in over ms milliseconds of time, the loaded music, playing it loop times through from start to finish.
The fade in effect only applies to the first loop.
The first time the music is played, it position will be set to position, which means different things for different types of music files, see Mix_SetMusicPosition
for more info on that.
Any previous music will be halted, or if it is fading out it will wait (blocking) for the fade to complete.
Please use the Mix_FadeInMusicStreamPos function to play multiple music streams in parallel.
Returns: 0 on success, or -1 on errors.
|
See Also:
Mix_PlayMusic,
Mix_FadeInMusic,
Mix_SetMusicPosition
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_VolumeMusicStream(Mix_Music *music, int volume)
Music to set the volume.
Music volume, from 0 to MIX_MAX_VOLUME(128).
Values greater than MIX_MAX_VOLUME will use MIX_MAX_VOLUME.
-1 does not set the volume, but does return the current volume setting.
Set the volume to volume, if it is 0 or greater, and return the previous volume setting.
Setting the volume during a fade will not work, the faders use this function to perform their effect!
Setting volume while using an external music player set by Mix_SetMusicCMD
will have no effect,
and Mix_GetError
will show the reason why not.
Returns: The previous volume setting.
|
See Also:
Mix_GetMusicVolume,
Mix_GetVolumeMusicStream,
Mix_VolumeMusicGeneral,
Mix_GetVolumeMusicGeneral,
Mix_FadeInMusicStream,
Mix_FadeOutMusicStream,
Mix_SetMusicCMD
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetMusicVolume(Mix_Music *music)
Music to get the volume.
Get the current volume set on the music.
Returns: The current volume setting set on the music.
See Also:
Mix_GetVolumeMusicStream,
Mix_VolumeMusicStream,
Mix_VolumeMusicGeneral,
Mix_GetVolumeMusicGeneral,
Mix_FadeInMusicStream,
Mix_FadeOutMusicStream,
Mix_SetMusicCMD
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetVolumeMusicStream(Mix_Music *music)
Music to get the volume.
Get the current volume set on the music. This is an alias to the Mix_GetMusicVolume function.
Returns: The current volume setting set on the music.
See Also:
Mix_GetMusicVolume,
Mix_VolumeMusicStream,
Mix_VolumeMusicGeneral,
Mix_GetVolumeMusicGeneral,
Mix_FadeInMusicStream,
Mix_FadeOutMusicStream,
Mix_SetMusicCMD
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_VolumeMusicGeneral(int volume)
General multi-stream music volume, from 0 to MIX_MAX_VOLUME(128).
Values greater than MIX_MAX_VOLUME will use MIX_MAX_VOLUME.
Set the general multi-stream music volume to volume, if it is 0 or greater.
Setting volume while using an external music player set by Mix_SetMusicCMD
will have no effect.
See Also:
Mix_GetMusicVolume,
Mix_VolumeMusicStream,
Mix_GetVolumeMusicGeneral,
Mix_FadeInMusicStream,
Mix_FadeOutMusicStream,
Mix_SetMusicCMD
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetVolumeMusicGeneral()
Get the current general multi-stream music volume.
Returns: The current general multi-stream music volume.
See Also:
Mix_GetMusicVolume,
Mix_VolumeMusicStream,
Mix_VolumeMusicGeneral,
Mix_FadeInMusicStream,
Mix_FadeOutMusicStream,
Mix_SetMusicCMD
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_PauseMusicStream(Mix_Music *music)
Music to pause.
Pause the music playback. You may halt paused music.
Note: Music can only be paused if it is actively playing.
|
See Also:
Mix_ResumeMusicStream,
Mix_PausedMusicStream,
Mix_HaltMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_PauseMusicStreamAll()
Pause all multi-stream music playback. You may halt any paused music.
Note: Music can only be paused if it is actively playing.
|
See Also:
Mix_ResumeMusicStream,
Mix_PausedMusicStream,
Mix_HaltMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ResumeMusicStream(Mix_Music *music)
Paused music to resume.
Unpause the music. This is safe to use on halted, paused, and already playing music.
|
See Also:
Mix_PauseMusicStream,
Mix_PausedMusicStream,
Mix_HaltMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ResumeMusicStreamAll()
Unpause all multi-stream music. This is safe to use on halted, paused, and already playing music.
|
See Also:
Mix_ResumeMusicStream,
Mix_PausedMusicStream,
Mix_HaltMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_RewindMusicStream(Mix_Music *music)
Music to rewind.
Rewind the music to the start. This is safe to use on halted, paused, and already playing music. It is not useful to rewind the music immediately after starting playback, because it starts at the beginning by default.
This function only works for streams that supports the seekability.
|
See Also:
Mix_PlayMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMusicPositionStream(Mix_Music *music, double position)
Music to change the position.
Position to play from in seconds.
Set the position of the music. The position takes different meanings for different music sources. It only works on the music sources listed below.
Jumps to position seconds from the beginning of the song.
ModPlug or XMP: Jumps to position seconds from the beginning of the song.
Passing zero is similar to rewinding the song.
Jumps to position seconds from the beginning of the song.
Jumps to position seconds from the beginning of the song.
Jumps to position seconds from the beginning of the song.
Jumps to position seconds from the beginning of the song.
Jumps to position seconds from the beginning of the song.
Works for libADLMIDI and libOPNMIDI. Doesn’t works for Timidity, FluidSynth, and NativeMIDI. Jumps to position seconds from the beginning of the song.
Returns: 0 on success, or -1 if the codec doesn’t support this function.
|
See Also:
Mix_FadeInMusicStreamPos,
Mix_GetMusicPosition,
Mix_MusicDuration,
Mix_StartTrack,
Mix_GetNumTracks
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
double Mix_GetMusicPosition(Mix_Music *music)
A pointer to current music stream
Get the time current position of music stream. It only works on some of music sources listed in table shown in description of Mix_SetMusicPosition function.
Returns: seconds value of current music position or -1.0 if this feature is not supported for some codec
See Also:
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration,
Mix_StartTrack,
Mix_GetNumTracks
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ModMusicStreamJumpToOrder(Mix_Music *music, int order)
Music to change the position.
A pattern number in the module.
Jump to a given order in mod music. Only for MOD music formats.
Returns: 0 if successful, or -1 if failed or isn’t implemented.
See Also:
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration,
Mix_StartTrack,
Mix_GetNumTracks
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_StartTrack(Mix_Music *music, int track)
Music to select a sub-song for play.
A song number from 0 to N-1 to play.
Starts a sub-song to play. This function works when one music file contains multiple songs, for example, various chiptunes like NSF, HES, or XMI-based MIDI files.
Returns: 0 if successful, or -1 if failed or isn’t implemented.
See Also:
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration,
Mix_ModMusicStreamJumpToOrder,
Mix_GetNumTracks
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetNumTracks(Mix_Music *music)
Music to get count of sub-songs inside.
Returns a total count of sub-songs inside the given music. This function works when one music file contains multiple songs, for example, various chiptunes like NSF, HES, or XMI-based MIDI files.
Returns: a total count of sub-songs inside the given music, or -1 if failed or isn’t implemented.
See Also:
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration,
Mix_ModMusicStreamJumpToOrder,
Mix_StartTrack
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
double Mix_MusicDuration(Mix_Music *music)
A pointer to current music stream
Get the full duration time of music stream. It only works on some of music sources listed in table shown in description of Mix_SetMusicPosition function.
Returns: seconds value of current music total length or -1.0 if this feature is not supported for some codec
See Also:
Mix_FadeInMusicPos,
Mix_GetMusicPosition,
Mix_SetMusicPosition,
Mix_StartTrack,
Mix_GetNumTracks
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
double Mix_GetMusicLoopStartTime(Mix_Music *music)
A pointer to current music stream
A part of loop points feature. Get the loop start time position of music stream. It only works on some of music sources.
Returns: seconds value of current music loop start position or -1.0 if this feature is not supported for some codec
See Also:
Mix_GetMusicLoopEndTime,
Mix_GetMusicLoopLengthTime
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
double Mix_GetMusicLoopEndTime(Mix_Music *music)
A pointer to current music stream
A part of loop points feature. Get the loop time length of music stream. It only works on some of music sources.
Returns: seconds value of current music loop end position or -1.0 if this feature is not supported for some codec
See Also:
Mix_GetMusicLoopStartTime,
Mix_GetMusicLoopLengthTime
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
double Mix_GetMusicLoopEndTime(Mix_Music *music)
A pointer to current music stream
A part of loop points feature. Get the loop time length of music stream. It only works on some of music sources.
Returns: seconds value of current music loop length time or -1.0 if this feature is not supported for some codec
See Also:
Mix_GetMusicLoopStartTime,
Mix_GetMusicLoopEndTime
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMusicTempo(Mix_Music *music, double tempo)
Music to change the tempo.
Tempo multiplier. Setting value into the 1.0 will reset the tempo into default.
Set the current tempo multiplier in the music stream.
Returns: 0 if successful, or -1 if failed or isn’t implemented.
See Also:
Mix_GetMusicTempo,
Mix_SetMusicSpeed,
Mix_SetMusicPitch,
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
double Mix_GetMusicTempo(Mix_Music *music)
Music to get the tempo.
Returns the current tempo multiplier of the music stream.
Returns: positive value if successful, or -1.0 if failed or isn’t implemented.
See Also:
Mix_SetMusicTempo,
Mix_SetMusicSpeed,
Mix_SetMusicPitch,
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMusicSpeed(Mix_Music *music, double speed)
Music to change the speed.
Speed multiplier. Setting value into the 1.0 will reset the speed into default.
Set the current speed (both tempo and pitch will be changed) multiplier in the music stream.
Returns: 0 if successful, or -1 if failed or isn’t implemented.
See Also:
Mix_GetMusicTempo,
Mix_GetMusicPitch,
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
double Mix_GetMusicSpeed(Mix_Music *music)
Music to get the speed.
Returns the current speed multiplier (both tempo and pitch will be changed) of the music stream.
Returns: positive value if successful, or -1.0 if failed or isn’t implemented.
See Also:
Mix_SetMusicTempo,
Mix_SetMusicPitch,
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMusicPitch(Mix_Music *music, double pitch)
Music to change the pitch.
Pitch multiplier. Setting value into the 1.0 will reset the tempo into default.
Set the current pitch multiplier in the music stream.
Returns: 0 if successful, or -1 if failed or isn’t implemented.
See Also:
Mix_GetMusicTempo,
Mix_GetMusicSpeed,
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
double Mix_GetMusicPitch(Mix_Music *music)
Music to get the pitch.
Returns the current pitch multiplier of the music stream.
Returns: positive value if successful, or -1.0 if failed or isn’t implemented.
See Also:
Mix_SetMusicTempo,
Mix_SetMusicSpeed,
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetMusicTracks(Mix_Music *music)
Music to get the number of tracks/channels.
Get the count of concurrently playing tracks at the song (MIDI, Tracker, Chiptune, etc.)
Returns: count of tracks/channels if successful, or -1 if failed or isn’t implemented.
See Also:
Mix_SetMusicTrackMute,
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetMusicTracks(Mix_Music *music, int track, int mute)
Music to get the number of tracks/channels.
Track/Channel number to mute
The mute state: 1 mute, 0 unmute
Mute one of playing tracks (or channels) at the song (MIDI, Tracker, Chiptune, etc.)
Returns: 0 if successful, or -1 if failed or isn’t implemented.
See Also:
Mix_GetMusicTracks,
Mix_FadeInMusicStreamPos,
Mix_SetMusicPositionStream,
Mix_MusicDuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMusicCMD(const char *command)
System command to play the music. Should be a complete command, as if typed in to the command line, but it should expect the filename to be added as the last argument.
NULL will turn off using an external command for music, returning to the internal music playing functionality.
Setup a command line music player to use to play music. Any music playing will be halted.
The music file to play is set by calling Mix_LoadMUS(filename)
, and the filename is appended as the last argument on the commandline. This allows you to reuse the music command to play multiple files. The command will be sent signals SIGTERM to halt, SIGSTOP to pause, and SIGCONT to resume. The command program should react correctly to those signals for it to function properly with SDL_Mixer. Mix_VolumeMusic
has no effect when using an external music player, and Mix_GetError
will have an error code set. You should set the music volume in the music player’s command if the music player supports that. Looping music works, by calling the command again when the previous music player process has ended. Playing music through a command uses a forked process to execute the music command.
To use the internal music players set the command to NULL.
NOTE: External music is not mixed by SDL_mixer, so no post-processing hooks will be for music.
NOTE: Playing music through an external command may not work if the sound driver does not support multiple openings of the audio device, since SDL_Mixer already has the audio device open for playing samples through channels.
NOTE: Commands are not totally portable, so be careful.
Returns: 0 on success, or -1 on any errors, such as running out of memory.
|
See Also:
Mix_PlayMusic,
Mix_VolumeMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetSynchroValue()
Not supported by any players at this time.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetSynchroValue(int value)
Not supported by any players at this time.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_SetMusicFileName(Mix_Music *music, const char *file)
The music to change the reported filename.
The file name or file path.
Change the filename reported by the Mix_GetMusicTitle function in a case when the actual title tag is not specified in the file.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_VolumeMusic(int volume)
Music volume, from 0 to MIX_MAX_VOLUME(128).
Values greater than MIX_MAX_VOLUME will use MIX_MAX_VOLUME.
-1 does not set the volume, but does return the current volume setting.
Set the volume to volume, if it is 0 or greater, and return the previous volume setting. Setting the volume during a fade will not work, the faders use this function to perform their effect! Setting volume while using an external music player set by Mix_SetMusicCMD
will have no effect, and Mix_GetError
will show the reason why not.
Returns: The previous volume setting.
|
See Also:
Mix_FadeInMusic,
Mix_FadeOutMusic,
Mix_SetMusicCMD
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_PauseMusic()
Pause the music playback. You may halt paused music.
Note: Music can only be paused if it is actively playing.
|
See Also:
Mix_ResumeMusic,
Mix_PausedMusic,
Mix_HaltMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ResumeMusic()
Unpause the music. This is safe to use on halted, paused, and already playing music.
|
See Also:
Mix_PauseMusic,
Mix_PausedMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_RewindMusic()
Rewind the music to the start. This is safe to use on halted, paused, and already playing music. It is not useful to rewind the music immediately after starting playback, because it starts at the beginning by default.
This function only works for these streams: MOD, OGG, MP3, Native MIDI.
|
See Also:
Mix_PlayMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMusicPosition(double position)
Position to play from.
Set the position of the currently playing music. The position takes different meanings for different music sources. It only works on the music sources listed below.
Jumps to position seconds from the beginning of the song.
ModPlug or XMP: Jumps to position seconds from the beginning of the song.
Passing zero is similar to rewinding the song.
Jumps to position seconds from the beginning of the song.
Jumps to position seconds from the beginning of the song.
Jumps to position seconds from the beginning of the song.
Jumps to position seconds from the beginning of the song.
Jumps to position seconds from the beginning of the song.
Works for libADLMIDI and libOPNMIDI. Doesn’t works for Timidity, FluidSynth, and NativeMIDI. Jumps to position seconds from the beginning of the song.
Returns: 0 on success, or -1 if the codec doesn’t support this function.
|
See Also:
Mix_FadeInMusicPos
Mix_GetMusicPosition
Mix_MusicDuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ModMusicJumpToOrder(int order)
A pattern number in the module.
Jump to a given order in mod music currently playing as a single-stream. Only for MOD music formats.
Returns: 0 if successful, or -1 if failed or isn’t implemented.
See Also:
Mix_FadeInMusicPos
Mix_SetMusicPosition
Mix_MusicDuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetMidiPlayer()
Tells currently using MIDI sequencer to play MIDI files.
Returns: The type of currently using MIDI device.
|
See Also:
Mix_SetMidiPlayer
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GetNextMidiPlayer()
Tells MIDI sequencer recently choosen by Mix_SetMidiPlayer which will be use in next open of MIDI file.
Returns: The type of currently using MIDI device.
|
See Also:
Mix_GetMidiPlayer,
Mix_SetMidiPlayer
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMidiPlayer(int device)
A MIDI_* enum value which identifies MIDI sequencer you want to use
Allows to choose a MIDI sequencer to play MIDI files. NOTE: new choosen MIDI device begins to work on MIDI music file reopen
Returns: 0 on success, or -1 on any errors, such as MIDI sequencer is unknown or does not built with this library assembly.
|
See Also:
Mix_SetLockMIDIArgs
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_SetLockMIDIArgs(int lock_midiargs)
0 to disable locking or 1 to enable locking of MIDI arguments passed through Mix_LoadMUS(filename)
function
Allows to don’t reset MIDI arguments to default when is no arguments passed through Mix_LoadMUS(filename)
function, or different arguments was passed.
|
See Also:
Mix_SetMidiPlayer
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_HaltMusicStream(Mix_Music *music)
Playing music to halt.
Halt playback of music. This interrupts music fader effects.
Any callback set by Mix_HookMusicStreamFinished
will be called when the music stops.
Note: Music will not be free automatically if you called the Mix_SetFreeOnStop function before.
Returns: always returns zero. (even more silly than Mix_HaltGroup)
|
See Also:
Mix_FadeOutMusicStream,
Mix_HookMusicStreamFinished,
Mix_HookMusicStreamFinishedAny
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeOutMusicStream(Mix_Music *music, int ms)
Playing music to fade out.
Milliseconds of time that the fade-out effect should take to go to silence, starting now.
Gradually fade out the music over ms milliseconds starting from now.
The music will be halted after the fade out is completed.
Only when music is playing and not fading already are set to fade out, including paused channels.
Any callback set by Mix_HookMusicStreamFinished
will be called when the music finishes fading out.
Note: Music will not be free automatically if you called the Mix_SetFreeOnStop function before
and if you set the ms delay to be 0.
Returns: 1 on success, 0 on failure.
|
See Also:
Mix_HaltMusicStream,
Mix_FadingMusicStream,
Mix_PlayingMusicStream,
Mix_HookMusicStreamFinished,
Mix_HookMusicStreamFinishedAny
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_HookMusicStreamFinished(Mix_Music *music, void (*music_finished)(SDLCALL *music_finished)(Mix_Music*, void*), void *user_data)
Music to set the hook.
Function pointer to a void function(Mix_Music *music, void *user_data)
.
NULL will remove the hook.
User data pointer used with the the music_finished callback
This sets up a function to be called when music playback is halted.
Any time music stops, the music_finished function will be called.
Call with NULL to remove the callback.
NOTE: NEVER call SDL_Mixer functions, nor SDL_LockAudio
, from a callback function.
|
See Also:
Mix_HaltMusicStream,
Mix_FadeOutMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_HookMusicStreamFinishedAny(void (*music_finished)())
Function pointer to a void function()
.
NULL will remove the hook.
This sets up a function to be called when any multi-stream music playback is halted.
Any time music stops, the music_finished function will be called. Call with NULL to remove the callback.
NOTE: NEVER call SDL_Mixer functions, nor SDL_LockAudio
, from a callback function.
|
See Also:
Mix_HaltMusicStream,
Mix_FadeOutMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_HaltMusic()
Halt playback of music. This interrupts music fader effects.
Any callback set by Mix_HookMusicFinished
will be called when the music stops.
Returns: always returns zero. (even more silly than Mix_HaltGroup)
|
See Also:
Mix_FadeOutMusic,
Mix_HookMusicFinished
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_FadeOutMusic(int ms)
Milliseconds of time that the fade-out effect should take to go to silence, starting now.
Gradually fade out the music over ms milliseconds starting from now.
The music will be halted after the fade out is completed. Only when music is playing and not fading already are set to fade out, including paused channels.
Any callback set by Mix_HookMusicFinished
will be called when the music finishes fading out.
Returns: 1 on success, 0 on failure.
|
See Also:
Mix_HaltMusic,
Mix_FadingMusic,
Mix_PlayingMusic,
Mix_HookMusicFinished
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_HookMusicFinished(void (*music_finished)())
Function pointer to a void function()
.
NULL will remove the hook.
This sets up a function to be called when single-stream music playback is halted. Any time music stops, the music_finished function will be called. Call with NULL to remove the callback.
NOTE: NEVER call SDL_Mixer functions, nor SDL_LockAudio
, from a callback function.
|
See Also:
Mix_HaltMusic,
Mix_FadeOutMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_MusicType Mix_GetMusicType(const Mix_Music *music)
The music to get the type of.
NULL will get the currently playing single-stream music type.
Tells you the file format encoding of the music. This may be handy when used
with Mix_SetMusicPosition
, and other music functions that vary based on
the type of music being played. If you want to know the type of music currently
being played, pass in NULL to music.
Returns: The type of music or if music is NULL then the currently playing music type, otherwise MUS_NONE if no music is playing.
|
See Also:
Mix_MusicType,
Mix_SetPosition
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_PlayingMusicStream(Mix_Music *music)
The music to get playing state.
NULL will get the currently playing music playing state.
Tells you if music is actively playing, or not.
Note: Does not check if the channel has been paused.
Returns: Zero if the music is not playing, or 1 if it is playing.
|
See Also:
Mix_PausedMusicStream,
Mix_FadingMusicStream,
Mix_PlayMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_PausedMusicStream(Mix_Music *music)
The music to get paused state.
NULL will get the currently playing music paused state.
Tells you if music is paused, or not.
Note: Does not check if the music was been halted after it was paused, which may seem a little weird.
Returns: Zero if music is not paused. 1 if it is paused.
|
See Also:
Mix_PlayingMusicStream,
Mix_PauseMusicStream,
Mix_ResumeMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Fading Mix_FadingMusicStream(Mix_Music *music)
The music to get fading state.
NULL will get the currently playing music fading state.
Tells you if music is fading in, out, or not at all. Does not tell you if the channel is playing anything, or paused, so you’d need to test that separately.
Returns: the fading status. Never returns an error.
|
See Also:
Mix_Fading,
Mix_PausedMusicStream,
Mix_PlayingMusicStream,
Mix_FadeInMusicStreamPos,
Mix_FadeOutMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void *Mix_GetMusicHookData()
Get the arg passed into Mix_HookMusic
.
Returns: the arg pointer.
|
See Also:
Mix_HookMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_PlayingMusic()
Tells you if any single-stream music is actively playing, or not.
Note: Does not check if the channel has been paused.
Returns: Zero if the any single-stream music is not playing, or 1 if it is playing.
|
See Also:
Mix_PausedMusic,
Mix_FadingMusic,
Mix_PlayMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_PausedMusic()
Tells you if music is paused, or not.
Note: Does not check if the music was been halted after it was paused, which may seem a little weird.
Returns: Zero if music is not paused. 1 if it is paused.
|
See Also:
Mix_PlayingMusic,
Mix_PauseMusic,
Mix_ResumeMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Mix_Fading Mix_FadingMusic()
Tells you if music is fading in, out, or not at all. Does not tell you if the channel is playing anything, or paused, so you’d need to test that separately.
Returns: the fading status. Never returns an error.
|
See Also:
Mix_Fading,
Mix_PausedMusic,
Mix_PlayingMusic,
Mix_FadeInMusicPos,
Mix_FadeOutMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_GetMusicTitle(const Mix_Music *music)
Get music title from meta-tag if possible. If title tag is empty, filename will be returned unlike the Mix_GetMusicTitleTag()
call.
Returns: the music title string pointer.
|
See Also:
Mix_GetMusicTitleTag,
Mix_GetMusicArtistTag,
Mix_GetMusicAlbumTag,
Mix_GetMusicCopyrightTag
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_GetMusicTitleTag(const Mix_Music *music)
Get music title from meta-tag if possible. If title tag is empty, returns NULL
Returns: the music title string pointer or NULL.
|
See Also:
Mix_GetMusicTitle,
Mix_GetMusicArtistTag,
Mix_GetMusicAlbumTag,
Mix_GetMusicCopyrightTag
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_GetMusicArtistTag(const Mix_Music *music)
Get music artist from meta-tag if possible. If artist tag is empty, returns NULL
Returns: the music artist string pointer or NULL.
|
See Also:
Mix_GetMusicTitle,
Mix_GetMusicTitleTag,
Mix_GetMusicAlbumTag,
Mix_GetMusicCopyrightTag
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_GetMusicAlbumTag(const Mix_Music *music)
Get music album from meta-tag if possible. If album tag is empty, returns NULL
Returns: the music album string pointer or NULL.
|
See Also:
Mix_GetMusicTitle,
Mix_GetMusicTitleTag,
Mix_GetMusicArtistTag,
Mix_GetMusicCopyrightTag
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_GetMusicCopyrightTag(const Mix_Music *music)
Get music copyright from meta-tag if possible. If copyright tag is empty, returns NULL
Returns: the music copyright string pointer or NULL.
|
See Also:
Mix_GetMusicTitle,
Mix_GetMusicTitleTag,
Mix_GetMusicArtistTag,
Mix_GetMusicAlbumTag
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetTimidityCfg(const char *path)
Timidity config file path.
Set the NULL to let Timidity use the default system paths by the internal logic.
The Timidity cfg file path which defines the set of patches used by the Timidity during playback.
Note: Takes no effect when no MIDI music files currently loaded by Timidity. To apply the config path change
you should unload all MIDI music using Mix_FreeMusic()
call and open them back again.
Timidity doesn’t support individual different patch sets per song.
Returns: 0 if success, -1 on failure.
|
See Also:
Mix_GetTimidityCfg,
Mix_PausedMusicStream,
Mix_FadingMusicStream,
Mix_PlayMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_GetTimidityCfg()
Reports the full path to the current config file. NULL if no custom config paths was set.
Returns: The full Timidity config file path or NULL.
See Also:
Mix_SetTimidityCfg,
Mix_PausedMusicStream,
Mix_FadingMusicStream,
Mix_PlayMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_GME_SetSpcEchoDisabled(Mix_Music *music, int *disabled)
The music to change the "SPC echo disabled" option
The boolean 0 or 1 value
This option allows you to disable the built-in echo in SPC files played via libGME (Game Music Emulators) library.
See Also:
Mix_GME_GetSpcEchoDisabled,
Mix_PausedMusicStream,
Mix_FadingMusicStream,
Mix_PlayMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_GME_GetSpcEchoDisabled(Mix_Music *music)
The music to get the value of the "SPC echo disabled" option.
Returns: The value of the "SPC echo disabled" option or -1 when option is unavailable for this music.
This option allows you to disable the built-in echo in SPC files played via libGME (Game Music Emulators) library.
See Also:
Mix_GME_SetSpcEchoDisabled,
Mix_PausedMusicStream,
Mix_FadingMusicStream,
Mix_PlayMusicStream
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetSoundFonts(const char *paths)
Semicolon separated paths to sound font files.
NULL to use default sound font paths from environment.
Set the paths list to sound font files will be used by FluidSynth MIDI backend.
Returns: 1 if path successfully set, or 0 if error has occouped.
|
See Also:
Mix_GetSoundFonts,
Mix_EachSoundFont,
Mix_EachSoundFontEx
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_GetSoundFonts()
Semicolon separated paths to sound font files.
NULL to use default sound font paths from environment.
Get the current set of paths list to sound font files will be used by FluidSynth MIDI backend. If there are wasn’t set by Mix_SetSoundFonts function, there are will be tooken from SDL_SOUNDFONTS or SDL_FORCE_SOUNDFONTS environment variables.
Returns: Semicolon-separated sound font paths.
|
See Also:
Mix_SetSoundFonts,
Mix_EachSoundFont,
Mix_EachSoundFontEx
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_EachSoundFont(int (*function)(const char *, void *), void *data)
The callback function will be called for each sound font listed in the paths. Has arguments path and data.
User data passed to the callback
Iterate the current set of paths list to sound font files will be used by FluidSynth MIDI backend. If there are wasn’t set by Mix_SetSoundFonts function, there are will be tooken from SDL_SOUNDFONTS or SDL_FORCE_SOUNDFONTS environment variables.
Returns: 1 if function successfully completed, or 0 if error has occouped.
|
See Also:
Mix_SetSoundFonts,
Mix_GetSoundFonts,
Mix_EachSoundFontEx
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *Mix_EachSoundFontEx(const char* cpaths, int (*function)(const char *, void *), void *data)
The semicolon-separated list of custom SoundFont file paths
The callback function will be called for each sound font listed in the paths. Has arguments path and data.
User data passed to the callback
Iterate the current set of internal paths list to sound font files will be used by FluidSynth MIDI backend, and additionally, iterate through the custom paths list given by the cpaths argument. If there are wasn’t set by Mix_SetSoundFonts function, there are will be tooken from SDL_SOUNDFONTS or SDL_FORCE_SOUNDFONTS environment variables.
Returns: 1 if function successfully completed, or 0 if error has occouped.
|
See Also:
Mix_SetSoundFonts,
Mix_GetSoundFonts,
Mix_EachSoundFont
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getTotalBanks()
Returns: Total count of embedded ADLMIDI banks.
Get total count of available embedded banks.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
const char *const * Mix_ADLMIDI_getBankNames()
Returns: array of strings are names of embedded ADLMIDI banks.
Get array of embedded bank titles.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getBankID()
Returns: currently using ID of embedded ADLMIDI bank.
Get currently using ID of embedded ADLMIDI bank.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setBankID(int bnk)
Embedded ADLMIDI bank ID
Change current embedded ADLMIDI bank. NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getTremolo()
Returns: 0 if Deep Tremolo is inactive, or 1 if Deep Tremolo is activated.
Get current state of "Deep Tremolo" OPL3 flag in ADLMIDI.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setTremolo(int tr)
State of Deep Tremolo flag: 0 if Deep Tremolo is inactive, or 1 if Deep Tremolo is activated
Set state of "Deep Tremolo" OPL3 flag. NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getVibrato()
Returns: 0 if Deep Vibrato is inactive, or 1 if Deep Vibrato is activated.
Get current state of "Deep Vibrato" OPL3 flag in ADLMIDI.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setVibrato(int vib)
State of Deep Vibrato flag: 0 if Deep Vibrato is inactive, or 1 if Deep Vibrato is activated
Set state of "Deep Vibrato" OPL3 flag. NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getScaleMod()
Returns: 0 if Scalable Modulation is inactive, or 1 if Scalable Modulation is activated.
Get current state of "Scalable modulation mode" flag
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setScaleMod(int sc)
State of Scalable Modulation flag: 0 if Scalable Modulation is inactive, or 1 if Scalable Modulation is activated
Turn on/off scalable modulation mode flag. NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getVolumeModel()
Returns: value of Mix_ADLMIDI_VolumeModel enum which a current volume model.
Get ID of current volumes model of ADLMIDI
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setVolumeModel(int vm)
Value of Mix_ADLMIDI_VolumeModel enum.
Change current volume model. NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getFullRangeBrightness()
Returns: 0 when full-ranged CC74 is disabled, or 1 when full-ranged mode of CC74 is enabled
Get full range mode for CC74-Brightness controller
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setFullRangeBrightness(int frb)
0 to disable full-ranged CC74, or 1 to enable full-ranged mode of CC74
Set full range mode for CC74-Brightness controller NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getAutoArpeggio()
Returns: 0 when automatic arpeggio disabled, or 1 when automatic arpeggio is enabled
Get the automatic apreggion enable/disable setting state
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setAutoArpeggio(int aa_en)
0 to disable the automatic arpeggio, or 1 to enable automatic arpeggio
Set the automatic apreggion enable/disable setting state NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getFullPanStereo()
Returns: 0 when full panning stereo is disabled, or 1 when full panning stereo is enabled
Get full panning stereo mode
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setFullPanStereo(int fp)
0 to disable full panning stereo, or 1 to enable full panning stereo
Set full panning stereo mode NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getEmulator()
Returns: value of Mix_ADLMIDI_Emulator enum which a current OPL3 emulator.
Get ID of current OPL3 emulator of ADLMIDI
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setVolumeModel(int emu)
Value of Mix_ADLMIDI_Emulator enum.
Select the default OPL3 Emulator for ADLMIDI used for every new MIDI file opened.
Note: Using path arguments may override this setting.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_ADLMIDI_getChipsCount()
Returns: initial number of emulated chips running by ADLMIDI.
Get the number of emulated chips used by ADLMIDI for every new MIDI file opened.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setChipsCount(int chips)
Number of emulated chips.
Get the number of emulated chips used by ADLMIDI for every new MIDI file opened.
Note: Using path arguments may override this setting.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setSetDefaults()
Resets all settings of ADLMIDI into default state. NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_ADLMIDI_setCustomBankFile(const char *bank_wonl_path)
Path to custom WOPL bank or NULL to use embedded banks.
Sets path to custom WOPL bank file. NOTE: Applies on MIDI file reopen
|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_OPNMIDI_getVolumeModel()
Returns: value of Mix_OPNMIDI_VolumeModel enum which a current volume model.
Get ID of current volumes model of OPNMIDI
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_OPNMIDI_setVolumeModel(int vm)
Value of Mix_OPNMIDI_VolumeModel enum.
Change current volume model. NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_OPNMIDI_getFullRangeBrightness()
Returns: 0 when full-ranged CC74 is disabled, or 1 when full-ranged mode of CC74 is enabled
Get full range mode for CC74-Brightness controller
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_OPNMIDI_setFullRangeBrightness(int frb)
0 to disable full-ranged CC74, or 1 to enable full-ranged mode of CC74
Set full range mode for CC74-Brightness controller NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_OPNMIDI_getAutoArpeggio()
Returns: 0 when automatic arpeggio disabled, or 1 when automatic arpeggio is enabled
Get the automatic apreggion enable/disable setting state
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_OPNMIDI_setAutoArpeggio(int aa_en)
0 to disable the automatic arpeggio, or 1 to enable automatic arpeggio
Set the automatic apreggion enable/disable setting state NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_OPNMIDI_getFullPanStereo()
Returns: 0 when full panning stereo is disabled, or 1 when full panning stereo is enabled
Get full panning stereo mode
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_OPNMIDI_setFullPanStereo(int fp)
0 to disable full panning stereo, or 1 to enable full panning stereo
Set full panning stereo mode NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_OPNMIDI_getEmulator()
Returns: value of Mix_OPNMIDI_Emulator enum which a current OPN2 emulator.
Get ID of current OPN2 emulator of OPNMIDI
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_OPNMIDI_setVolumeModel(int emu)
Value of Mix_OPNMIDI_Emulator enum.
Select the OPN2 Emulator for OPNMIDI NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_OPNMIDI_getChipsCount()
Returns: initial number of emulated chips running by OPNMIDI.
Get the number of emulated chips used by OPNMIDI for every new MIDI file opened.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_OPNMIDI_setChipsCount(int chips)
Number of emulated chips.
Get the number of emulated chips used by OPNMIDI for every new MIDI file opened.
Note: Using path arguments may override this setting.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_OPNMIDI_setSetDefaults()
Resets all settings of OPNMIDI into default state. NOTE: Applies on MIDI file reopen
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_OPNMIDI_setCustomBankFile(const char *bank_wonp_path)
Path to custom WOPN bank or NULL to use default bank.
Sets path to custom WOPN bank file. NOTE: Applies on MIDI file reopen
|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Also known as a Path arguments. This is a special formatted string that can be concoctated with the music file path using the | separator,
or being passed as a dedicated argument. There are individual music properties given to it during the load time.
Using these arguments you can choose the track to play (suitable for files that contains multiple songs inside the same file), or select
the MIDI synthesizer or its porperties and a banks or SoundFont paths, etc.
Depending on the music format and the codec library there are different arguments supported
The first argument - an integer from 0 to n - a number of the track from multi-track file formats like NSF, NSFE, HES, GBS, etc.
Example 1 of the music path with music arguments given:
|
Example 2 of the music path with music arguments given:
|
Example music arguments strings to be sent as a dedicated argument:
|
All arguments after the first integer are optional. The leading integer is required, even it’s a single-track file. The last argument must be closed with semicolon.
Initial tempo factor (1.0 is the default value, accepting positive floating-point number values, for example, t=1.75;
), increase or decrease the initial tempo of the song.
Gain factor (1.0 is the default value, accepting positive floating-point number values, for example, g=1.75;
), increase or decrease the volume level of the song. Use it to increase the volume of too silent songs, or decrease the volume of too loud songs.
Accepts a list of letter-marked integer arguments separated by semicolons.
Example 1 of the music path with music arguments given:
|
Example 2 of the music path with music arguments given:
|
Example music arguments strings to be sent as a dedicated argument:
|
All arguments are optional. The last argument must be closed with semicolon.
Synthesizer type:
0
- ADLMIDI, emulated OPL3 (YMF262) synthesizer with loop tags and System Exclusive Messages support. Works by Default. OPL3 chip was widely used on PC sound cards in 80/90’th years.
1
- Timidity, requires the set of patches to be properly installed (can be customized with Mix_SetTimidityCfg function).
2
- Native MIDI, uses the default operating system MIDI interface.
3
- OPNMIDI, emulated OPN2 (YM2612) synthesizer with loop tags and System Exclusive Messages support. OPN2 chip is used on the Sega MegaDrive / Genesis game console.
4
- FluidSynth, the WaveTable MIDI synthesizer with SoundFont banks support, has the support for loop tags support.
5
- Emu De Midi, emulated OPLL and SCC synthesizer, has the support for loop tags support.
Example:
|
ADLMIDI, OPNMIDI, FluidSynth, and Emu De Midi
Initial tempo factor (1.0 is the default value, accepting positive floating-point number values, for example, t=1.75;
), increase or decrease the initial tempo of the song. Don’t confuse with t0
and t1
which is a different setting.
Example:
|
ADLMIDI, OPNMIDI, FluidSynth, and Emu De Midi
Gain factor (2.0 is the default value, accepting positive floating-point number values, for example, g=1.75;
), increase or decrease the volume level of the song. Use it to increase the volume of too silent songs, or decrease the volume of too loud songs.
Example:
|
ADLMIDI
Set bank ID (look for available banks list into PGE MusPlay application to preview them). Default is 58.
Example:
|
ADLMIDI
Deep tremolo (1 or 0, or -1 an auto-mode), increase the amplitude of tremolo effect for instruments that are using tremolo OPL flag. Default -1. Don’t confuse with t=
which is a different setting.
Example:
|
ADLMIDI
Deep vibrato (1 or 0, or -1 an auto-mode), increase the amplitude of vibrato effect for instruments that are using vibrato OPL flag. Default -1.
Example:
|
ADLMIDI
Enables scalable modulation (1 or 0), Allows dynamic scaling of the modulator result with volume. Default 0.
Example:
|
ADLMIDI AND OPNMIDI
Count of chip emulators are allowing to excite limit of voice channels. Default 4 for ADLMIDI and 8 for OPNMIDI. Allowed value from 1 to 100.
Example:
|
ADLMIDI
Count of four-operator channels between all chip emulators (6 channels maximum per every chip. For example, you have used 2 chips, you can have 12 four-op channels maximum).
Example:
|
ADLMIDI AND OPNMIDI
Enable or disable the automatic arpeggio (1 or 0). Default 1.
Example:
|
ADLMIDI AND OPNMIDI
Volume scaling model code (0 - auto, 1 - Generic, - 2 OPL3-Native, 3 - DMX, 4 - Apogee, - 5 - Win9X-like) - an algorithm to scale a volume level, affects music expressionism.
Example:
|
ADLMIDI AND OPNMIDI
Use full-ranged CC74 Brightness MIDI controller (1 or 0). Default 0.
Example:
|
ADLMIDI AND OPNMIDI
Enable full-panning stereo support (1 or 0). Default 1.
Example:
|
ADLMIDI
Choose OPL3 emulator: 0 - Nuked OPL3 (Very accurate, may lag on older CPUs), 1 - Nuked OPL3 1.7.4 that was optimized by Troosh, and 2 - DosBox 0.74 (Well-accurate, fastest).
Example:
|
OPNMIDI
Choose OPN2 emulator: 0 - Mame YM2612 (Well-accurate, fast), 1 - Nuked OPN2 (Very accurate, requires VERY powerful CPU. Suggested to use up to 2 chips max with it), 2 - GENS 2.10 (Very outdated, inaccurate, but fastest)
Example:
|
ADLMIDI and OPNMIDI
Load custom bank file by absolute path (WOPN bank for OPNMIDI or WOPL for ADLMIDI). Accepting strings without quotes.
Example:
|
FluidSynth
Enable or disable the reverb effect: 0 - disabled, 1 - enabled.
Example:
|
FluidSynth
Reverb room size value (0.0-1.0).
Example:
|
FluidSynth
Reverb damping value (0.0-1.0).
Example:
|
FluidSynth
Reverb width value (0.0-100.0).
Example:
|
FluidSynth
Reverb level value (0.0-1.0).
Example:
|
FluidSynth
Enable or disable the chorus effect: 0 - disabled, 1 - enabled.
Example:
|
FluidSynth
Chorus voice count (0-99, CPU time consumption proportional to this value).
Example:
|
FluidSynth
Chorus level (0.0-10.0).
Example:
|
FluidSynth
Chorus speed in Hz (0.1-5.0).
Example:
|
FluidSynth
Chorus depth (max value depends on synth sample-rate, 0.0-21.0 is safe for sample-rate values up to 96KHz).
Example:
|
FluidSynth
Chorus waveform type: 0 - Sine, 1 - Triangle.
Example:
|
FluidSynth
Define the allowed polyphony (8-512).
Example:
|
FluidSynth
Load custom SoundFont files by absolute path. Accepting strings without quotes, for example, x=/path/to/bank/file.sf2;
. You can specify multiple SoundFont files by using an ampersand separator: x=/p/file1.sf2&/p/file2.sf2&/p/filen.sf2;
Example:
|
Available since the 2th of June 2023. This functionality right now is avilable when the library was built with using of stb_vorbis library.
Turning multi-channel OGG file into multi-track music (will be possible to use the Mix_GetMusicTracks() and Mix_SetMusicTrackMute() functions):
|
All arguments after the first integer are optional. The leading integer is required, even it’s a single-track file. The last argument must be closed with semicolon.
Enable the multi-track mode: turn multi-channel song into multi-track stream with an ability to mute each separated "track". 0 - disabled, 1 - enabled.
Number of channels for each track. (Max is 8 due to SDL AudioStream)
Total number of available tracks.
Initial speed factor (1.0 is the default value, accepting positive floating-point number values, for example, ‘s=1.75;‘), increase or decrease the initial speed of the song (i.e. both tempo and pitch gets changed).
See Also:
Mix_LoadMUS,
Mix_LoadMUS_RW_ARG,
Mix_LoadMUSType_RW_ARG
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions are for special effects processing. Not all effects are all that special. All effects are post processing routines that are either built-in to SDL_mixer or created by you. Effects can be applied to individual channels, or to the final mixed stream which contains all the channels including music.
Registration | ||
---|---|---|
5.6.1 Mix_RegisterEffect | Hook a processor to a channel | |
5.6.2 Mix_UnregisterEffect | Unhook a processor from a channel | |
5.6.3 Mix_UnregisterAllEffects | Unhook all processors from a channel | |
5.6.4 Mix_RegisterMusicEffect | Hook a processor to a music [Mixer X] | |
5.6.5 Mix_UnregisterMusicEffect | Unhook a processor from a music [Mixer X] | |
5.6.6 Mix_UnregisterAllMusicEffects | Unhook all processors from a music [Mixer X] | |
5.6.7 Mix_SetPostMix | Hook in a postmix processor | |
Built-in Processors | ||
5.6.8 Mix_SetPanning | Stereo panning for a channel | |
5.6.9 Mix_SetDistance | Distance attenuation (volume) | |
5.6.10 Mix_SetPosition | Panning(angular) and distance | |
5.6.11 Mix_SetReverseStereo | Swap stereo left and right | |
5.6.12 Mix_SetMusicEffectPanning | Stereo panning for a music [Mixer X] | |
5.6.13 Mix_SetMusicEffectDistance | Distance attenuation (volume) for a music [Mixer X] | |
5.6.14 Mix_SetMusicEffectPosition | Panning(angular) and distance for a music [Mixer X] | |
5.6.15 Mix_SetMusicEffectReverseStereo | Swap stereo left and right for a music [Mixer X] |
The built-in processors: Mix_SetPanning, Mix_SetPosition, Mix_SetDistance, and
, all look for an environment variable, MIX_EFFECTSMAXSPEED to be
defined.
If the environment variable is defined these processors may use more memory or reduce the quality of the effects, all for better speed.
Mix_SetReverseStereo
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_RegisterEffect(int chan, Mix_EffectFunc_t f, Mix_EffectDone_t d, void *arg) |
channel number to register f and d on.
Use MIX_CHANNEL_POST to process the postmix stream.
The function pointer for the effects processor.
The function pointer for any cleanup routine to be called when the channel is done playing a sample.
This may be NULL for any processors that don’t need to clean up any memory or other dynamic data.
A pointer to data to pass into the f’s and d’s udata
parameter. It is a good place to keep the state data for the processor, especially if the processor is made to handle multiple channels at the same time.
This may be NULL, depending on the processor.
Hook a processor function f into a channel for post processing effects. You may just be reading the data and displaying it, or you may be altering the stream to add an echo. Most processors also have state data that they allocate as they are in use, this would be stored in the arg pointer data space. When a processor is finished being used, any function passed into d will be called, which is when your processor should clean up the data in the arg data space.
The effects are put into a linked list, and always appended to the end, meaning they always work on previously registered effects output. Effects may be added multiple times in a row. Effects are cumulative this way.
Returns: Zero on errors, such as a nonexisting channel.
|
See Also:
Mix_UnregisterEffect,
Mix_UnregisterAllEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f)
Channel number to remove f from as a post processor.
Use MIX_CHANNEL_POST for the postmix stream.
The function to remove from channel.
Remove the oldest (first found) registered effect function f from the effect list for channel. This only removes the first found occurance of that function, so it may need to be called multiple times if you added the same function multiple times, just stop removing when Mix_UnregisterEffect
returns an error, to remove all occurances of f from a channel.
If the channel is active the registered effect will have its Mix_EffectDone_t
function called, if it was specified in Mix_RegisterEffect
.
Returns: Zero on errors, such as invalid channel, or effect function not registered on channel.
|
See Also:
Mix_UnregisterAllEffects,
Mix_RegisterEffect
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_UnregisterAllEffects(int channel)
Channel to remove all effects from.
Use MIX_CHANNEL_POST for the postmix stream.
This removes all effects registered to channel.
If the channel is active all the registered effects will have their Mix_EffectDone_t
functions called, if they were specified in Mix_RegisterEffect
.
Returns: Zero on errors, such as channel not existing.
|
See Also:
Mix_UnregisterEffect,
Mix_RegisterEffect
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_RegisterMusicEffect(Mix_Music *music, Mix_MusicEffectFunc_t f, Mix_MusicEffectDone_t d, void *arg) |
music to register f and d on.
The function pointer for the music effects processor.
The function pointer for any cleanup routine to be called when the music is getting closed up.
This may be NULL for any processors that don’t need to clean up any memory or other dynamic data.
A pointer to data to pass into the f’s and d’s udata
parameter. It is a good place
to keep the state data for the processor, especially if the processor is made to handle multiple channels
at the same time.
This may be NULL, depending on the processor.
Hook a processor function f into a music for post processing effects. You may just be reading
the data and displaying it, or you may be altering the stream to add an echo. Most processors also have
state data that they allocate as they are in use, this would be stored in the arg pointer data space.
When a processor is finished being used, any function passed into d will be called, which is when
your processor should clean up the data in the arg data space.
The effects are put into a linked list, and always appended to the end, meaning they always work on
previously registered effects output. Effects may be added multiple times in a row.
Effects are cumulative this way.
Returns: Zero on errors, such as a nonexisting music.
|
See Also:
Mix_UnregisterMusicEffect,
Mix_UnregisterAllMusicEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_UnregisterMusicEffect(Mix_Music music, Mix_MusicEffectFunc_t f)
Music to remove f from as a post processor.
The function to remove from music.
Remove the oldest (first found) registered effect function f from the effect list for channel.
This only removes the first found occurance of that function, so it may need to be called multiple times
if you added the same function multiple times, just stop removing when Mix_UnregisterMusicEffect
returns
an error, to remove all occurances of f from a channel.
If the music is active the registered effect will have its Mix_MusicEffectDone_t
function called,
if it was specified in Mix_RegisterMusicEffect
.
Returns: Zero on errors, such as invalid music, or effect function not registered on music.
|
See Also:
Mix_RegisterMusicEffect,
Mix_UnregisterAllMusicEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_UnregisterAllMusicEffects(Mix_Music *music)
Music to remove all effects from.
This removes all effects registered to music.
If the music is active all the registered effects will have their Mix_MusicEffectDone_t
functions called, if they were specified in Mix_RegisterMusicEffect
.
Returns: Zero on errors, such as music not existing.
|
See Also:
Mix_RegisterMusicEffect,
Mix_UnregisterMusicEffect
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void Mix_SetPostMix(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg) |
The function pointer for the postmix processor.
NULL unregisters the current postmixer.
A pointer to data to pass into the mix_func’s udata
parameter. It is a good place to keep the state data for the processor, especially if the processor is made to handle multiple channels at the same time.
This may be NULL, depending on the processor.
Hook a processor function mix_func to the postmix stream for post processing effects. You may just be reading the data and displaying it, or you may be altering the stream to add an echo. Most processors also have state data that they allocate as they are in use, this would be stored in the arg pointer data space.
This processor is never really finished, until the audio device is closed, or you pass NULL as the mix_func.
There can only be one postmix function used at a time through this method. Use Mix_RegisterEffect(MIX_CHANNEL_POST, mix_func, NULL, arg)
to use multiple postmix processors.
This postmix processor is run AFTER all the registered postmixers set up by Mix_RegisterEffect
.
|
See Also:
Mix_RegisterEffect
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetPanning(int channel, Uint8 left, Uint8 right)
Channel number to register this effect on.
Use MIX_CHANNEL_POST to process the postmix stream.
Volume for the left channel, range is 0(silence) to 255(loud)
Volume for the left channel, range is 0(silence) to 255(loud)
This effect will only work on stereo audio. Meaning you called Mix_OpenAudio
with 2 channels (MIX_DEFAULT_CHANNELS). The easiest way to do true panning is to call
Mix_SetPanning(channel, left, 254 - left);
so that the total volume is correct,
if you consider the maximum volume to be 127 per channel for center, or 254 max for left, this works, but about halves the effective volume.
This Function registers the effect for you, so don’t try to Mix_RegisterEffect
it yourself.
NOTE: Setting both left and right to 255 will unregister the effect from
channel. You cannot unregister it any other way, unless you use
Mix_UnregisterAllEffects
on the channel.
NOTE: Using this function on a mono audio device will not register the effect, nor will it return an error status.
Returns: Zero on errors, such as bad channel, or if Mix_RegisterEffect
failed.
|
See Also:
Mix_SetPosition,
Mix_UnregisterAllEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetDistance(int channel, Uint8 distance)
Channel number to register this effect on.
Use MIX_CHANNEL_POST to process the postmix stream.
Specify the distance from the listener, from 0(close/loud) to 255(far/quiet).
This effect simulates a simple attenuation of volume due to distance. The volume never quite reaches silence, even at max distance.
NOTE: Using a distance of 0 will cause the effect to unregister itself from channel. You cannot unregister it any other way, unless you use Mix_UnregisterAllEffects
on the channel.
Returns: Zero on errors, such as an invalid channel, or if Mix_RegisterEffect
failed.
|
See Also:
Mix_SetPosition,
Mix_UnregisterAllEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetPosition(int channel, Sint16 angle, Uint8 distance)
Channel number to register this effect on.
Use MIX_CHANNEL_POST to process the postmix stream.
Direction in relation to forward from 0 to 360 degrees. Larger angles will be reduced to this range using angles % 360
.
0 = directly in front.
90 = directly to the right.
180 = directly behind.
270 = directly to the left.
So you can see it goes clockwise starting at directly in front.
This ends up being similar in effect to Mix_SetPanning
.
The distance from the listener, from 0(near/loud) to 255(far/quiet).
This is the same as the Mix_SetDistance
effect.
This effect emulates a simple 3D audio effect. It’s not all that realistic, but it can help improve some level of realism. By giving it the angle and distance from the camera’s point of view, the effect pans and attenuates volumes. If you are looking for better positional audio, using OpenAL is suggested.
NOTE: Using angle and distance of 0, will cause the effect to unregister itself from channel. You cannot unregister it any other way, unless you use Mix_UnregisterAllEffects
on the channel.
Returns: Zero on errors, such as an invalid channel, or if Mix_RegisterEffect
failed.
|
See Also:
Mix_SetPanning,
Mix_SetDistance,
Mix_UnregisterAllEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetReverseStereo(int channel, int flip)
Channel number to register this effect on.
Use MIX_CHANNEL_POST to process the postmix stream.
Must be non-zero to work, means nothing to the effect processor itself.
set to zero to unregister the effect from channel.
Simple reverse stereo, swaps left and right channel sound.
NOTE: Using a flip of 0, will cause the effect to unregister itself from channel. You cannot unregister it any other way, unless you use Mix_UnregisterAllEffects
on the channel.
Returns: Zero on errors, such as an invalid channel, or if Mix_RegisterEffect
failed.
|
See Also:
Mix_UnregisterAllEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMusicEffectPanning(Mix_Music *music, Uint8 left, Uint8 right)
Music to register this effect on.
Volume for the left channel, range is 0(silence) to 255(loud)
Volume for the left channel, range is 0(silence) to 255(loud)
This effect will only work on stereo audio. Meaning you called Mix_OpenAudio
with 2 channels (MIX_DEFAULT_CHANNELS). The easiest way to do true panning is to call
Mix_SetMusicEffectPanning(music, left, 254 - left);
so that the total volume is correct,
if you consider the maximum volume to be 127 per channel for center, or 254 max for left, this works,
but about halves the effective volume.
This Function registers the effect for you, so don’t try to Mix_RegisterMusicEffect
it yourself.
NOTE: Setting both left and right to 255 will unregister the effect from
music. You cannot unregister it any other way, unless you use
Mix_UnregisterAllMusicEffects
on the music.
NOTE: Using this function on a mono audio device will not register the effect,
nor will it return an error status.
Returns: Zero on errors, such as bad music, or if Mix_RegisterMusicEffect
failed.
|
See Also:
Mix_SetMusicEffectPosition,
Mix_UnregisterAllMusicEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMusicEffectDistance(Mix_Music *music, Uint8 distance)
Music to register this effect on.
Specify the distance from the listener, from 0(close/loud) to 255(far/quiet).
This effect simulates a simple attenuation of volume due to distance.
The volume never quite reaches silence, even at max distance.
NOTE: Using a distance of 0 will cause the effect to unregister itself from channel.
You cannot unregister it any other way, unless you use Mix_UnregisterAllMusicEffects
on the music.
Returns: Zero on errors, such as an invalid music, or if Mix_RegisterMusicEffect
failed.
|
See Also:
Mix_SetMusicEffectPosition,
Mix_UnregisterAllMusicEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMusicEffectPosition(Mix_Music *music, Sint16 angle, Uint8 distance)
Music to register this effect on.
Direction in relation to forward from 0 to 360 degrees. Larger angles will be reduced to this range using angles % 360
.
0 = directly in front.
90 = directly to the right.
180 = directly behind.
270 = directly to the left.
So you can see it goes clockwise starting at directly in front.
This ends up being similar in effect to Mix_SetMusicEffectPanning
.
The distance from the listener, from 0(near/loud) to 255(far/quiet).
This is the same as the Mix_SetMusicEffectDistance
effect.
This effect emulates a simple 3D audio effect.
It’s not all that realistic, but it can help improve some level of realism.
By giving it the angle and distance from the camera’s point of view, the effect pans and attenuates volumes.
If you are looking for better positional audio, using OpenAL is suggested.
NOTE: Using angle and distance of 0, will cause the effect to unregister itself
from music.
You cannot unregister it any other way, unless you use Mix_UnregisterAllMusicEffects
on the music.
Returns: Zero on errors, such as an invalid music, or if Mix_RegisterMusicEffect
failed.
|
See Also:
Mix_SetMusicEffectPanning,
Mix_SetMusicEffectDistance,
Mix_UnregisterAllMusicEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int Mix_SetMusicEffectReverseStereo(Mix_Music *music, int flip)
Music to register this effect on.
Must be non-zero to work, means nothing to the effect processor itself.
set to zero to unregister the effect from music.
Simple reverse stereo, swaps left and right channel sound.
NOTE: Using a flip of 0, will cause the effect to unregister itself from music.
You cannot unregister it any other way, unless you use Mix_UnregisterAllMusicEffects
on the music.
Returns: Zero on errors, such as an invalid music, or if Mix_RegisterMusicEffect
failed.
|
See Also:
Mix_UnregisterAllMusicEffects
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These types are defined and used by the SDL_mixer API.
6.1 Mix_Chunk | The internal format for an audio chunk | |
6.2 Mix_Music | The internal format for a music chunk | |
6.3 Mix_MusicType | Music type enumerations | |
6.4 Mix_MIDI_Device | MIDI sequencer type enumerations [Mixer X] | |
6.5 Mix_ADLMIDI_VolumeModel | Volume model of libADLMIDI MIDI sequencer [Mixer X] | |
6.6 Mix_ADLMIDI_Emulator | OPL3 chip emulators used by ADLMIDI [Mixer X] | |
6.7 Mix_OPNMIDI_VolumeModel | Volume model of libOPNMIDI MIDI sequencer [Mixer X] | |
6.8 Mix_OPNMIDI_Emulator | OPN2 chip emulators used by OPNMIDI [Mixer X] | |
6.9 Mix_Fading | Fader effect type enumerations | |
6.10 Mix_EffectFunc_t | Special channel effect callback function pointer | |
6.11 Mix_EffectDone_t | Special channel effect done callback function pointer | |
6.12 Mix_MusicEffectFunc_t | Special music effect callback function pointer | |
6.13 Mix_MusicEffectDone_t | Special music effect done callback function pointer | |
6.14 Mix_CommonMixer_t | Common mixer function pointer |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
a boolean indicating whether to free abuf when the chunk is freed.
0 if the memory was not allocated and thus not owned by this chunk.
1 if the memory was allocated and is thus owned by this chunk.
Pointer to the sample data, which is in the output format and sample rate.
Length of abuf in bytes.
0 = silent, 128 = max volume. This takes effect when mixing.
The internal format for an audio chunk. This stores the sample data, the length in bytes of that data, and the volume to use when mixing the sample.
See Also:
Mix_VolumeChunk,
Mix_GetChunk,
Mix_LoadWAV,
Mix_LoadWAV_RW,
Mix_FreeChunk,
Mix_Music
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
This is an opaque data type used for Music data. This should always be used as a pointer. Who knows why it isn’t a pointer in this typedef...
See Also:
Mix_LoadMUS,
Mix_FreeMusic,
Mix_Chunk
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
Return values from Mix_GetMusicType
are of these enumerated values.
If no music is playing then MUS_NONE is returned.
If music is playing via an external command then MUS_CMD is returned.
If music is playing via an Game Music Emulators then MUS_GME is returned.
MUS_SPC is legacy value added as single SPC playing support before GME was added. Use MUS_GME instead.
MUS_KnownCodecs is a count of known music codecs. Used internally.
Otherwise they are self explanatory.
See Also:
Mix_GetMusicType
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
MIDI_KnownDevices is a count of known MIDI sequencers. Used internally.
Otherwise they are self explanatory.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
ADLMIDI_VM_AUTO is automatical choice of volume model in dependence from selected bank.
Otherwise they are self explanatory.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
ADLMIDI_OPL3_EMU_NUKED is a Nuked OPL3 1.8 emulator which a very accurate, but needs a powerful CPU.
ADLMIDI_OPL3_EMU_NUKED_1_7_4 is an unofficial optimized Nuked OPL3 1.7.4. Needs a powerful CPU.
ADLMIDI_OPL3_EMU_DOSBOX is a DosBox 0.74 emulator. Fast emulator.
ADLMIDI_OPL3_EMU_OPAL is a Opal emulator made by developers of the Reality Adlib Tracker. Doesn’t implements rhythm mode.
ADLMIDI_OPL3_EMU_JAVA is a C++ port of the "That Vintage Tone" Java-written emulator by Robson Cozendey.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
OPNMIDI_VM_AUTO is automatical choice of volume model in dependence from selected bank.
Otherwise they are self explanatory.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
OPNMIDI_OPN2_EMU_MIME is a MAME YM2612 emulator, fast and well-accurate.
OPNMIDI_OPN2_EMU_NUKED is a Nuked OPN2 is a very accurate, but needs a VERY powerful CPU. It’s much stronger even than Nuked OPL3!
OPNMIDI_OPN2_EMU_GENS is a GENS GS/II emulator. Isn’t so accurate, but the fastest emulator here.
OPNMIDI_OPN2_EMU_GX is a Genesis Plus GX emulator, a fork of the MAME. Experimental and usually disabled by default at the libOPNMIDI side.
OPNMIDI_OPN2_EMU_NP2 is a Neko Project II Kai OPNA emulator. Performance is almost same as GENS.
OPNMIDI_OPN2_EMU_MAME_OPNA is a MIME OPNA emulator, very similar to MAME YM2612, but works a bit differently.
OPNMIDI_OPN2_EMU_PMDWIN is a PMDWIN OPNA emulator, old and dirty emulator.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
Return values from Mix_FadingMusic
and Mix_FadingChannel
are of these enumerated values.
If no fading is taking place on the queried channel or music, then MIX_NO_FADING is returned.
Otherwise they are self explanatory.
See Also:
Mix_FadingChannel,
Mix_FadingMusic
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
The channel number that this effect is effecting now.
MIX_CHANNEL_POST is passed in for post processing effects over the final mix.
The buffer containing the current sample to process.
The length of stream in bytes.
User data pointer that was passed in to Mix_RegisterEffect
when registering this
effect processor function.
This is the prototype for effect processing functions. These functions are used to apply effects processing on a sample chunk. As a channel plays a sample, the registered effect functions are called. Each effect would then read and perhaps alter the len bytes of stream. It may also be advantageous to keep the effect state in the udata, with would be setup when registering the effect function on a channel.
See Also:
Mix_RegisterEffect
Mix_UnregisterEffect
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
The channel number that this effect is effecting now.
MIX_CHANNEL_POST is passed in for post processing effects over the final mix.
User data pointer that was passed in to Mix_RegisterEffect
when registering this
effect processor function.
This is the prototype for effect processing functions. This is called when a channel has finished playing, or halted, or is deallocated. This is also called when a processor is unregistered while processing is active. At that time the effects processing function may want to reset some internal variables or free some memory. It should free memory at least, because the processor could be freed after this call.
See Also:
Mix_RegisterEffect
Mix_UnregisterEffect
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
The music that this effect is effecting now.
The buffer containing the current sample to process.
The length of stream in bytes.
User data pointer that was passed in to Mix_RegisterMusicEffect
when registering this
effect processor function.
This is the prototype for effect processing functions. These functions are used to apply effects processing on a music. As a music plays a sample, the registered effect functions are called. Each effect would then read and perhaps alter the len bytes of stream. It may also be advantageous to keep the effect state in the udata, with would be setup when registering the effect function on a channel.
See Also:
Mix_RegisterMusicEffect
Mix_UnregisterMusicEffect
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
The music that this effect is effecting now.
User data pointer that was passed in to Mix_RegisterMusicEffect
when registering this
effect processor function.
This is the prototype for effect processing functions. This is called when a music has finished playing, or halted, or is deallocated. This is also called when a processor is unregistered while processing is active. At that time the effects processing function may want to reset some internal variables or free some memory. It should free memory at least, because the processor could be freed after this call.
See Also:
Mix_RegisterMusicEffect
Mix_UnregisterMusicEffect
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
User data pointer that you can pass into the function.
The destination buffer to write the data.
The length of the buffer to write the data.
This is the prototype for the internal mixer processing callback. You should to call given callbacks to run the internal mixer processing and get the final audio data ready for output.
See Also:
Mix_GetMusicMixer
Mix_GetMultiMusicMixer
Mix_GetGeneralMixer
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2
SDL_mixer library major number at compilation time
5
SDL_mixer library minor number at compilation time
0
SDL_mixer library patch level at compilation time
1
Presense of this macro identifies the use of the MixerX extended fork library
8
The default mixer has this many simultaneous mixing channels after the first
call to Mix_OpenAudio
.
44100
Good default sample rate in Hz (samples per second) for PC sound cards.
AUDIO_S16SYS
The suggested default is signed 16bit samples in host byte order.
2
Stereo sound is a good default.
128
Maximum value for any volume setting.
This is currently the same as SDL_MIX_MAXVOLUME.
-2
This is the channel number used for post processing effects.
"MIX_EFFECTSMAXSPEED"
A convience definition for the string name of the environment variable to define
when you desire the internal effects to sacrifice quality and/or RAM for speed.
The environment variable must be set (else nonexisting) before Mix_OpenAudio
is called for the setting to take effect.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | B L M R S |
---|
Jump to: | B L M R S |
---|
[Top] | [Contents] | [Index] | [ ? ] |
[Top] | [Contents] | [Index] | [ ? ] |
[Top] | [Contents] | [Index] | [ ? ] |
This document was generated on November 23, 2023 using texi2html 1.82.
The buttons in the navigation panels have the following meaning:
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ < ] | Back | Previous section in reading order | 1.2.2 |
[ > ] | Forward | Next section in reading order | 1.2.4 |
[ << ] | FastBack | Beginning of this chapter or previous chapter | 1 |
[ Up ] | Up | Up section | 1.2 |
[ >> ] | FastForward | Next chapter | 2 |
[Top] | Top | Cover (top) of document | |
[Contents] | Contents | Table of contents | |
[Index] | Index | Index | |
[ ? ] | About | About (help) |
where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:
This document was generated on November 23, 2023 using texi2html 1.82.