1 // --------------------------------------------------------------------------
2 // Name: sndmsad(pcm).h
3 // Purpose: MS ADPCM codec
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 2000
7 // --------------------------------------------------------------------------
12 #pragma interface "sndmsad.h"
16 #include "wx/dynarray.h"
17 #include "wx/mmedia/sndcodec.h"
18 #include "wx/mmedia/sndbase.h"
20 WX_DEFINE_EXPORTED_ARRAY(wxUint16
, wxMSAdpcmCoeffs
);
25 class WXDLLEXPORT wxSoundFormatMSAdpcm
: public wxSoundFormatBase
{
27 wxSoundFormatMSAdpcm();
28 ~wxSoundFormatMSAdpcm();
30 void SetSampleRate(wxUint32 srate
);
31 wxUint32
GetSampleRate() const;
33 void SetSamplesBlock(wxUint16 sampblock
);
34 wxUint16
GetSamplesBlock() const;
36 void SetCoefs(wxMSAdpcmCoefs
& coefs
);
37 wxMSAdpcmCoefs
& GetCoefs() const;
39 wxSoundFormatType
GetType() const { return wxSOUND_ULAW
; }
40 wxSoundFormatBase
*Clone() const;
42 wxUint32
GetTimeFromBytes(wxUint32 bytes
) const;
43 wxUint32
GetBytesFromTime(wxUint32 time
) const;
45 bool operator !=(const wxSoundFormatBase
& frmt2
) const;
49 wxMSAdpcmCoefs
*m_coefs
;
53 // MS ADPCM converter class
55 class WXDLLEXPORT wxSoundRouterStream
;
56 class WXDLLEXPORT wxSoundStreamAdpcm
: public wxSoundStreamCodec
{
58 wxSoundStreamAdpcm(wxSoundStream
& sndio
);
59 ~wxSoundStreamAdpcm();
61 wxSoundStream
& Read(void *buffer
, wxUint32 len
);
62 wxSoundStream
& Write(const void *buffer
, wxUint32 len
);
64 bool SetSoundFormat(const wxSoundFormatBase
& format
);
66 wxUint32
GetBestSize() const;
69 wxSoundRouterStream
*m_router
;