I'm coding a game in SDL2 and I'm implementing the audio system using SDL_Mixer. However, my music file won't play during the program and I don't know why. How do I get the music to play?
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);
Opening the audio device:
if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0) std::cout << "Error:" << Mix_GetError() << std::endl;
Loading the sound file:
Mix_Chunk *soundEffect = Mix_LoadWAV("Sound\BetaMusic.wav");
Playing the sound file:
Mix_PlayChannel(-1, soundEffect, -1);