示例#1
0
/*** 
      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;
}
示例#2
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);
  }
}
示例#3
0
文件: cd_revol.c 项目: Izhido/qrevpak
void CDAudio_Pause(void)
{
	if (!enabled)
		return;

	if (!playing)
		return;

	PauseOgg(1);

	wasPlaying = playing;
	playing = false;
}
示例#4
0
/***
      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);	
  }
}
示例#5
0
文件: cd_revol.c 项目: Izhido/qrevpak
void CDAudio_Resume(void)
{
	if (!enabled)
		return;
	
	if (!cdValid)
		return;

	if (!wasPlaying)
		return;

	PauseOgg(0);

	playing = true;
}
示例#6
0
void GuiSound::Resume()
{
	if(voice < 0)
		return;

	switch(type)
	{
		case SOUND_PCM:
		ASND_PauseVoice(voice, 0);
		break;

		case SOUND_OGG:
		PauseOgg(0);
		break;
	}
}
示例#7
0
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
}
示例#8
0
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;
}
示例#9
0
/*** 
      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;
}