volumes.cpp

Playing with given volumes

00001 //$Id: volumes.cpp 195 2005-08-23 05:41:49Z tapted $ $URL: file:///var/svn/pub/taptaudio/trunk/tests/volumes.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::setDebugLevel(5);
00015     AudioSystem as;
00016     ASSample *s = as.loadSample(WAVPATH "/hellow.wav");
00017     if (!s)
00018         return 1;
00019 
00020     vp(s, 1.0);
00021     vp(s, 0.5);
00022     vp(s, 2.0);
00023     vp(s, 1.5);
00024     vp(s, 0.25);
00025     vp(s, 0.1);
00026     vp(s, 3.0);
00027     vp(s, 4.0);
00028     vp(s, 5.0);
00029     vp(s, 6.0);
00030     vp(s, 7.0);
00031     vp(s, 8.0);
00032     vp(s, 9.0);
00033     vp(s, 10.0);
00034     return 0;
00035 }
00036 

Generated on Thu Mar 16 11:30:41 2006 for TaptAudio by  doxygen 1.4.6