Guest User

Untitled

a guest
Jul 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1.  
  2. first open the audio device
  3.  
  4.  
  5. if(Mix_OpenAudio(44100, AUDIO_S16, 2, 2048)){
  6. printf("Mix_OpenAudio: %s\n", Mix_GetError());
  7. exit(-1);
  8. };
  9.  
  10.  
  11.  
  12.  
  13. //below in the load_sound macro , y will be of type Mix_Chunk*
  14.  
  15. #define load_sound(x,y) y = Mix_LoadWAV(x); \
  16. if(!y) exit(-1);
  17. #define play_sound(x) Mix_PlayChannel(1, some_Mix_Chunk_pointer_goes_here , 0);
Add Comment
Please, Sign In to add comment