No audio with SDL/C++
问题 void LoadMusic(string path); Mix_Music* gMusic = NULL; LoadMusic("Music/bubble-bobble.mp3"); if(Mix_PlayingMusic() == 0) { Mix_PlayMusic(gMusic, -1); } if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0) { cout << "Mixer could not initialise. error: " << Mix_GetError(); return false; } Mix_FreeMusic(gMusic); gMusic = NULL; void LoadMusic(string path) { gMusic = Mix_LoadMUS(path.c_str()); if(gMusic == NULL) { cout << "Failed to load background music! Error: " << Mix_GetError() << endl; }