00001 //$Id: mixing.cpp 221 2005-10-26 04:16:46Z tapted $ $URL: file:///var/svn/pub/taptaudio/trunk/tests/mixing.cpp $ 00002 00003 #include "taptaudio.h" 00004 00005 #include <SDL.h> 00006 00007 void vp(ASSample* s, float vol) { 00008 fprintf(stderr, "Playing for 1 second at %f%% volume\n", vol*100); 00009 AudioSystem::get()->mixSample(s, vol); 00010 SDL_Delay(1000); 00011 } 00012 00013 int main(int, char*[]) { 00014 AudioSystem as (AF_Default, 44100, 1 , 2); 00015 00016 ASSample *s = as.loadSample(WAVPATH "/mix.wav"); 00017 if (!s) 00018 return 1; 00019 vp(s, 1.0); 00020 vp(s, 0.5); 00021 vp(s, 2.0); 00022 vp(s, 1.5); 00023 vp(s, 0.25); 00024 vp(s, 0.1); 00025 vp(s, 3.0); 00026 vp(s, 4.0); 00027 vp(s, 5.0); 00028 vp(s, 6.0); 00029 vp(s, 7.0); 00030 vp(s, 8.0); 00031 // vp(s, 9.0); 00032 // vp(s, 10.0); 00033 SDL_Delay(3000); 00034 return 0; 00035 } 00036