// Author: Marcel Rasche, Vaclav Slavik
// Modified by:
// Created: 25/10/98
-// RCS-ID: $Id$
// Copyright: (c) Julian Smart, Open Source Applications Foundation
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
Create(sFileName, isResource);
}
-wxSound::wxSound(int size, const wxByte* data) : m_data(NULL)
+wxSound::wxSound(size_t size, const void* data) : m_data(NULL)
{
Create(size, data);
}
return true;
}
-bool wxSound::Create(int size, const wxByte* data)
+bool wxSound::Create(size_t size, const void* data)
{
wxASSERT( data != NULL );
Stop();
- delete ms_backend;
- ms_backend = NULL;
+ wxDELETE(ms_backend);
#if wxUSE_LIBSDL && wxUSE_PLUGINS
delete ms_backendSDL;
#endif
#define WAVE_INDEX 8
#define FMT_INDEX 12
-bool wxSound::LoadWAV(const wxUint8 *data, size_t length, bool copyData)
+bool wxSound::LoadWAV(const void* data_, size_t length, bool copyData)
{
// the simplest wave file header consists of 44 bytes:
//
if ( length < 44 )
return false;
+ const wxUint8* data = static_cast<const wxUint8*>(data_);
+
WAVEFORMAT waveformat;
memcpy(&waveformat, &data[FMT_INDEX + 4], sizeof(WAVEFORMAT));
waveformat.uiSize = wxUINT32_SWAP_ON_BE(waveformat.uiSize);