/*** gx_audio_Start This function restarts the audio engine This is called when coming back from Main Menu ***/ void gx_audio_Start(void) { /* shutdown background music */ PauseOgg(1); StopOgg(); /* shutdown menu audio processing */ ASND_Pause(1); ASND_End(); AUDIO_StopDMA(); AUDIO_RegisterDMACallback(NULL); DSP_Halt(); /* DMA Interrupt callback */ AUDIO_RegisterDMACallback(ai_callback); /* emulation is synchronized with audio hardware by default */ audioSync = AUDIO_WAIT; /* reset emulation audio processing */ memset(soundbuffer, 0, sizeof(soundbuffer)); audioWait = 0; bufferSize = 0; bufferIndex = 0; }
/* AUDIO engine shutdown */ void gx_audio_Shutdown(void) { PauseOgg(1); StopOgg(); ASND_Pause(1); ASND_End(); if (Bg_music_ogg) { free(Bg_music_ogg); } }
void CDAudio_Pause(void) { if (!enabled) return; if (!playing) return; PauseOgg(1); wasPlaying = playing; playing = false; }
/*** gx_audio_Stop This function stops current Audio DMA process This is called when going back to Main Menu ***/ void gx_audio_Stop(void) { /* restart menu audio processing */ DSP_Unhalt(); ASND_Init(); ASND_Pause(0); /* play background music */ if (Bg_music_ogg && !Shutdown) { PauseOgg(0); PlayOgg((char *)Bg_music_ogg, Bg_music_ogg_size, 0, OGG_INFINITE_TIME); SetVolumeOgg(((int)config.bgm_volume * 255) / 100); } }
void CDAudio_Resume(void) { if (!enabled) return; if (!cdValid) return; if (!wasPlaying) return; PauseOgg(0); playing = true; }
void GuiSound::Resume() { if(voice < 0) return; switch(type) { case SOUND_PCM: ASND_PauseVoice(voice, 0); break; case SOUND_OGG: PauseOgg(0); break; } }
void GuiSound::Pause() { #ifndef NO_SOUND if (voice < 0) return; switch (type) { case SOUND_PCM: ASND_PauseVoice(voice, 1); break; case SOUND_OGG: PauseOgg(1); break; } #endif }
int AalibPause(int channel) { if ((PSPAALIB_CHANNEL_WAV_1<=channel)&&(channel<=PSPAALIB_CHANNEL_WAV_32)) { return PauseWav(channel-PSPAALIB_CHANNEL_WAV_1); } if ((PSPAALIB_CHANNEL_OGG_1<=channel)&&(channel<=PSPAALIB_CHANNEL_OGG_10)) { return PauseOgg(channel-PSPAALIB_CHANNEL_OGG_1); } if ((PSPAALIB_CHANNEL_SCEMP3_1<=channel)&&(channel<=PSPAALIB_CHANNEL_SCEMP3_2)) { return PauseSceMp3(channel-PSPAALIB_CHANNEL_SCEMP3_1); } if ((PSPAALIB_CHANNEL_AT3_1<=channel)&&(channel<=PSPAALIB_CHANNEL_AT3_2)) { return PauseAt3(channel-PSPAALIB_CHANNEL_AT3_1); } return PSPAALIB_ERROR_INVALID_CHANNEL; }
/*** gx_audio_Start This function restart the audio engine This is called when coming back from Main Menu ***/ void gx_audio_Start(void) { /* shutdown background music */ PauseOgg(1); StopOgg(); /* shutdown menu audio processing */ ASND_Pause(1); AUDIO_StopDMA(); AUDIO_RegisterDMACallback(NULL); DSP_Halt(); /* when not using 60hz mode, frame emulation is synchronized with Audio Interface DMA */ if (gc_pal | vdp_pal) { AUDIO_RegisterDMACallback(ai_callback); } /* reset emulation audio processing */ memset(soundbuffer, 0, 2 * 3840); audioStarted = 0; mixbuffer = 0; }