// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "sound.h"
-#pragma implementation "soundbase.h"
-#endif
-
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#if wxUSE_THREADS
return m_status.m_playing;
#else
- return FALSE;
+ return false;
#endif
}
return false;
}
- wxFileOffset len = fileWave.Length();
+ wxFileOffset lenOrig = fileWave.Length();
+ if ( lenOrig == wxInvalidOffset )
+ return false;
+
+ size_t len = wx_truncate_cast(size_t, lenOrig);
wxUint8 *data = new wxUint8[len];
- if (fileWave.Read(data, len) != len)
+ if ( fileWave.Read(data, len) != lenOrig )
{
wxLogError(_("Couldn't load sound data from '%s'."), fileName.c_str());
return false;
wxUint16 uiBitsPerSample;
} WAVEFORMAT;
-#define MONO 1 // and stereo is 2 by wav format
#define WAVE_FORMAT_PCM 1
#define WAVE_INDEX 8
#define FMT_INDEX 12