Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Thursday, June 13, 2019
 
 

SDL_MixAudio (3)

Name

SDL_MixAudio - Mix audio data

Synopsis

#include "SDL.h"

void SDL_MixAudio(Uint8 *dst, Uint8 *src, Uint32 len, int volume);

Description

SDL_MixAudio(3)                SDL API Reference               SDL_MixAudio(3)



NAME
       SDL_MixAudio - Mix audio data

SYNOPSIS
       #include "SDL.h"

       void SDL_MixAudio(Uint8 *dst, Uint8 *src, Uint32 len, int volume);

DESCRIPTION
       This  function takes two audio buffers of len bytes each of the playing
       audio format and mixes them, performing  addition,  volume  adjustment,
       and  overflow  clipping.  The volume ranges from 0 to SDL_MIX_MAXVOLUME
       and should be set to the maximum value for full audio volume. Note this
       does  not  change  hardware volume. This is provided for convenience --
       you can mix your own audio data.

              Note:

              Do not use this function  for  mixing  together  more  than  two
              streams  of sample data. The output from repeated application of
              this function may be distorted by clipping, because there is  no
              accumulator  with  greater  range than the input (not to mention
              this being an inefficient way of doing it). Use mixing functions
              from SDL_mixer, OpenAL, or write your own mixer instead.


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+------------------+
       |ATTRIBUTE TYPE | ATTRIBUTE VALUE  |
       +---------------+------------------+
       |Availability   | library/sdl      |
       +---------------+------------------+
       |Stability      | Volatile         |
       +---------------+------------------+
SEE ALSO
       SDL_OpenAudio



NOTES
       This     software     was    built    from    source    available    at
       https://github.com/oracle/solaris-userland.   The  original   community
       source        was        downloaded        from        https://www.lib-
       sdl.org/release/SDL-1.2.15.tar.gz

       Further information about this software can be found on the open source
       community website at https://www.libsdl.org/.



SDL                         Tue 11 Sep 2001, 22:58             SDL_MixAudio(3)