Exemple #1
0
/*
	Initialize PVR to defaults and sndoggvorbis
*/
void Init(){
	vid_set_mode(DM_640x480,PM_RGB565);
	vid_border_color(0,255,0);
	pvr_init_defaults();
	
	snd_stream_init();
	sndoggvorbis_init();
	
}
Exemple #2
0
int sndoggvorbis_init() {
	if (thd) {
		printf("sndserver: already initialized!\n");
		return -1;
	}

	if (snd_stream_init() < 0)
		return -1;

	printf("sndserver: initializing sndoggvorbis 0.7 [OggVorbis 1.0 based]\n");
	thd = thd_create(0, sndserver_thread, NULL);
	if (thd != NULL) {
		/* Wait until the oggvorbis decoder thread is ready */
		sndoggvorbis_wait_start();
		printf("sndserver: successfully created thread\n");
		return 0;
	} else {
		printf("sndserver: error creating thread\n");
		return -1;
	}
}
Exemple #3
0
void SoundInit(void)
{
#ifndef NOSOUND
		unsigned char  i;
		int  ret;
		char buf[128];
		 

#ifdef DREAMCAST
		SoundEnable = TRUE;
		snd_stream_init();
		sndoggvorbis_init();
		  
		for(i=0;i<9;i++)
		{
			snprintf(buf, sizeof(buf), "/rd/se0%d.wav", i);
			SEPool[i] = snd_sfx_load(buf); 
		}

		for(i=0;i<5;i++)
		{
			snprintf(buf, sizeof(buf), "/rd/bgm00%d.ogg", i);
			snprintf(BGMPool[i], sizeof(BGMPool[i]), "%s", buf);
		}
#else
		
		track = 0;

		SoundEnable = TRUE;
		ret = Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 1024);
		if (ret != 0) 
		{
			SoundEnable = FALSE;
			return;
		}
		
		for(i=0; i<8; i++) 
		{
			Mix_Volume(i, VOLUMEDEFAULT);
		}
		
		Mix_VolumeMusic(VOLUMEDEFAULT);

		for(i=0; i<BGMMAX; i++) 
		{
			BGMPool[i][0] = 0;
		}
		
		for(i=0; i<SEMAX; i++) 
		{
			SEPool[i] = 0;
		}
	  
	#ifdef NO_SNPRINTF
		for(i=0;i<5;i++)
		{
			sprintf(buf, "./data/bgm00%d.ogg", i);
			sprintf(BGMPool[i], "%s", buf);
		}
		  
		for(i=0;i<9;i++)
		{
			sprintf(buf, "./data/se0%d.wav", i);
			SEPool[i] = Mix_LoadWAV(buf);
		}
	#else
		for(i=0;i<5;i++)
		{
			snprintf(buf, sizeof(buf), "./data/bgm00%d.ogg", i);
			snprintf(BGMPool[i], sizeof(BGMPool[i]), "%s", buf);
		}
		  
		for(i=0;i<9;i++)
		{
			snprintf(buf, sizeof(buf), "./data/se0%d.wav", i);
			SEPool[i] = Mix_LoadWAV(buf);
		}
	#endif
	
#endif
		
#endif	//NOSOUND
}