mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Merge branch 'sdl-sound-fix' into 'master'
SDL: Force use DirectSound driver to fix wrong-pitch sound effects See merge request STJr/SRB2!375
This commit is contained in:
		
						commit
						94b00b6b67
					
				
					 2 changed files with 12 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -92,6 +92,12 @@ void I_StartupSound(void)
 | 
			
		|||
{
 | 
			
		||||
	I_Assert(!sound_started);
 | 
			
		||||
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
	// Force DirectSound instead of WASAPI
 | 
			
		||||
	// SDL 2.0.6+ defaults to the latter and it screws up our sound effects
 | 
			
		||||
	SDL_setenv("SDL_AUDIODRIVER", "directsound", 1);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	// EE inits audio first so we're following along.
 | 
			
		||||
	if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1186,6 +1186,12 @@ void I_StartupSound(void)
 | 
			
		|||
	// Configure sound device
 | 
			
		||||
	CONS_Printf("I_StartupSound:\n");
 | 
			
		||||
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
	// Force DirectSound instead of WASAPI
 | 
			
		||||
	// SDL 2.0.6+ defaults to the latter and it screws up our sound effects
 | 
			
		||||
	SDL_setenv("SDL_AUDIODRIVER", "directsound", 1);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	// EE inits audio first so we're following along.
 | 
			
		||||
	if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
 | 
			
		||||
		CONS_Printf("SDL Audio already started\n");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue