comparison src/audio/SDL_mixer.c @ 2049:5f6550e5184f

Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 17 Oct 2006 09:15:21 +0000
parents 7abe37467fa5
children 3ee59c43d784
comparison
equal deleted inserted replaced
2048:6067c7f9a672 2049:5f6550e5184f
87 87
88 /* The volume ranges from 0 - 128 */ 88 /* The volume ranges from 0 - 128 */
89 #define ADJUST_VOLUME(s, v) (s = (s*v)/SDL_MIX_MAXVOLUME) 89 #define ADJUST_VOLUME(s, v) (s = (s*v)/SDL_MIX_MAXVOLUME)
90 #define ADJUST_VOLUME_U8(s, v) (s = (((s-128)*v)/SDL_MIX_MAXVOLUME)+128) 90 #define ADJUST_VOLUME_U8(s, v) (s = (((s-128)*v)/SDL_MIX_MAXVOLUME)+128)
91 91
92 void
93 SDL_MixAudio(Uint8 * dst, const Uint8 * src, Uint32 len, int volume)
94 {
95 /* Mix the user-level audio format */
96 if (current_audio) {
97 SDL_AudioFormat format;
98 if (current_audio->convert.needed) {
99 format = current_audio->convert.src_format;
100 } else {
101 format = current_audio->spec.format;
102 }
103 SDL_MixAudioFormat(dst, src, format, len, volume);
104 }
105 }
106
107 92
108 void 93 void
109 SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, 94 SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format,
110 Uint32 len, int volume) 95 Uint32 len, int volume)
111 { 96 {