Audio::Audio() { m_music_path[0] = "res/sounds/musics/music_1.wav"; // hit_paddle_effect m_effects_paths[0] = "res/sounds/effects/hit_paddle.wav"; // score_up_effect m_effects_paths[1] = "res/sounds/effects/score_up.wav"; // ball_speed_up m_effects_paths[2] = "res/sounds/effects/speed_up.wav"; if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) != 0) { Debug::log_err("Audio system couldn't be initialized. Due to: ", Mix_GetError()); show_audio_drivers(); m_audio_opened = false; } else { Debug::log("Audio system initialized."); m_audio_opened = true; load_musics(); load_effects(); } }
/* FUNCION: audio_init Inicio del mixer. */ int audio_init(void) { #ifndef NOSOUND if (!load_sounds()) return 0; /* Se cargan las musicas */ return load_musics(); #else return 1; #endif }