From 74d26b28147b288995787b77b049eb6120f113e4 Mon Sep 17 00:00:00 2001 From: gibbed Date: Mon, 13 Jan 2014 00:23:29 -0800 Subject: [PATCH] Still wrong, but... --- src/xenia/apu/xaudio2/xaudio2_audio_system.cc | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/xenia/apu/xaudio2/xaudio2_audio_system.cc b/src/xenia/apu/xaudio2/xaudio2_audio_system.cc index 0668bd716..7a21cf814 100644 --- a/src/xenia/apu/xaudio2/xaudio2_audio_system.cc +++ b/src/xenia/apu/xaudio2/xaudio2_audio_system.cc @@ -79,14 +79,21 @@ void XAudio2AudioSystem::Initialize() { exit(1); } - WAVEFORMATEX waveformat; - waveformat.wFormatTag = WAVE_FORMAT_PCM; - waveformat.nChannels = 1; - waveformat.nSamplesPerSec = 44100; - waveformat.nAvgBytesPerSec = 44100 * 2; - waveformat.nBlockAlign = 2; - waveformat.wBitsPerSample = 16; - waveformat.cbSize = 0; + WAVEFORMATIEEEFLOATEX waveformat; + waveformat.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + waveformat.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + waveformat.Format.nChannels = 6; + waveformat.Format.nSamplesPerSec = 44100; + waveformat.Format.wBitsPerSample = 32; + waveformat.Format.nBlockAlign = (waveformat.Format.nChannels * waveformat.Format.wBitsPerSample) / 8; // 4 + waveformat.Format.nAvgBytesPerSec = waveformat.Format.nSamplesPerSec * waveformat.Format.nBlockAlign; // 44100 * 4 + waveformat.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); + waveformat.Samples.wValidBitsPerSample = waveformat.Format.wBitsPerSample; + waveformat.dwChannelMask = + SPEAKER_FRONT_LEFT | SPEAKER_FRONT_CENTER | SPEAKER_FRONT_RIGHT | + SPEAKER_LOW_FREQUENCY | + SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT; + hr = audio_->CreateSourceVoice(&pcm_voice_, (WAVEFORMATEX*)&waveformat); hr = audio_->CreateSourceVoice( &pcm_voice_, &waveformat, 0, XAUDIO2_DEFAULT_FREQ_RATIO, voice_callback_);