Waave is based on the SDL library so you need initialize the SDL environment first. So include the SDL headers followed by the waave headers.
#include <SDL.h> #include <WAAVE.h>
Waave require that you initialize SDL with support for audio, video and timer.
/************/ /* init sdl */ /************/ if( SDL_Init( SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_TIMER ) < 0 ) { fprintf( stderr, "Video initialization failed: %s\n", SDL_GetError( ) ); SDL_Quit( ); exit(0); }
If you don't know SDL check the SDL wiki. A complete SDL base program can be found here : sdl_base program
/* init waave*/ WV_waaveInit(WAAVE_INIT_AUDIO|WAAVE_INIT_VIDEO);
To stop the waave you just have to launch the close function. This will close also all the opened streams.
/* close waave engine */ WV_waaveClose();