From a11cb73f5b976f0058528a1cc6874b634b1b1d5a Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Mon, 17 May 2010 13:02:09 +0000 Subject: [PATCH] SPU-X: Committing a patch by KrossX3 that should fix the stereo expansion option for *most* people. Of course on my setup it fails to grab the correct number of speakers, so will have to think about it.. The code is correct though, so it should fix it for some people :p git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3035 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/spu2-x/src/Windows/SndOut_XAudio2.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/spu2-x/src/Windows/SndOut_XAudio2.cpp b/plugins/spu2-x/src/Windows/SndOut_XAudio2.cpp index 6e949b9969..1074ad7c94 100644 --- a/plugins/spu2-x/src/Windows/SndOut_XAudio2.cpp +++ b/plugins/spu2-x/src/Windows/SndOut_XAudio2.cpp @@ -265,8 +265,11 @@ public: XAUDIO2_DEVICE_DETAILS deviceDetails; pXAudio2->GetDeviceDetails( 0, &deviceDetails ); + // Defaults to Stereo + int speakers = 2; + // nChannels gives the current Windows' Speaker setup (6 if 5.1) if( StereoExpansionEnabled ) - deviceDetails.OutputFormat.Format.nChannels = 6; + speakers = deviceDetails.OutputFormat.Format.nChannels; // Any windows driver should support stereo at the software level, I should think! jASSUME( deviceDetails.OutputFormat.Format.nChannels > 1 ); @@ -274,14 +277,14 @@ public: // // Create a mastering voice // - if ( FAILED(hr = pXAudio2->CreateMasteringVoice( &pMasteringVoice, deviceDetails.OutputFormat.Format.nChannels, SampleRate ) ) ) + if ( FAILED(hr = pXAudio2->CreateMasteringVoice( &pMasteringVoice, speakers, SampleRate ) ) ) { SysMessage( "Failed creating mastering voice: %#X\n", hr ); CoUninitialize(); return -1; } - switch( deviceDetails.OutputFormat.Format.nChannels ) + switch( speakers ) { case 2: ConLog( "* SPU2 > Using normal 2 speaker stereo output.\n" );