Skip to content

Commit

Permalink
Fix inability to create WaveOut device
Browse files Browse the repository at this point in the history
  • Loading branch information
SerVB committed Oct 19, 2021
1 parent 61fe7cb commit ec90bf7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gxlib/gxl.audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ iSoundPlayer::~iSoundPlayer()

bool iSoundPlayer::HasAudioDev()
{
WAVEFORMATEX wfex = {WAVE_FORMAT_PCM, 1, 22050, 44100, 4, 16, 0 };
WAVEFORMATEX wfex = {WAVE_FORMAT_PCM, 1, 22050, 44100, 2, 16, 0 };
HWAVEOUT hWaveOut = NULL;
if ( MMSYSERR_NOERROR != ::waveOutOpen( &hWaveOut, WAVE_MAPPER, &wfex, 0, 0, CALLBACK_NULL) ) {
return false;
Expand All @@ -251,7 +251,7 @@ bool iSoundPlayer::Init()

m_hWorkThread = ::CreateThread(NULL, 0, MixerThread, this, CREATE_SUSPENDED, &m_idWorkThread);

WAVEFORMATEX wfex = {WAVE_FORMAT_PCM, 1, 22050, 44100, 4, 16, 0 };
WAVEFORMATEX wfex = {WAVE_FORMAT_PCM, 1, 22050, 44100, 2, 16, 0 };
if ( MMSYSERR_NOERROR != ::waveOutOpen( &m_hWaveOut, WAVE_MAPPER, &wfex, m_idWorkThread, (DWORD)this, CALLBACK_THREAD ) ) {
check(0 == "Unable to open WaveOut device!");
return false;
Expand Down

0 comments on commit ec90bf7

Please sign in to comment.