1999-08-15 06:28:21 -04:00
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
// Name: test_med.cpp
|
|
|
|
// Purpose:
|
|
|
|
// Date: 08/11/1999
|
|
|
|
// Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
|
|
|
|
// CVSID: $Id$
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
#include <wx/app.h>
|
|
|
|
#include <wx/wfstream.h>
|
|
|
|
#include <wx/frame.h>
|
|
|
|
#include "../lib/sndoss.h"
|
1999-11-06 12:44:03 -05:00
|
|
|
#include "../lib/sndesd.h"
|
1999-08-15 06:28:21 -04:00
|
|
|
#include "../lib/sndwav.h"
|
|
|
|
#include "../lib/sndaiff.h"
|
|
|
|
|
|
|
|
class MyApp: public wxApp {
|
|
|
|
bool OnInit() {
|
1999-11-06 12:44:03 -05:00
|
|
|
// wxSoundStreamOSS *oss_dev = new wxSoundStreamOSS();
|
|
|
|
wxSoundStreamESD *oss_dev = new wxSoundStreamESD();
|
1999-08-15 06:28:21 -04:00
|
|
|
wxFileInputStream *f_input = new wxFileInputStream(argv[1]);
|
1999-11-06 12:44:03 -05:00
|
|
|
wxSoundFileStream *wav_file;
|
1999-08-15 06:28:21 -04:00
|
|
|
wxFrame *frame = new wxFrame(NULL, -1, "My Frame");
|
|
|
|
wxSoundFormatPcm pcm;
|
|
|
|
|
|
|
|
if (oss_dev->GetError() != wxSOUND_NOERR) {
|
|
|
|
wxPrintf("No device\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1999-11-06 12:44:03 -05:00
|
|
|
wav_file = new wxSoundWave(*f_input, *oss_dev);
|
|
|
|
if (!wav_file->CanRead()) {
|
|
|
|
wav_file = new wxSoundAiff(*f_input, *oss_dev);
|
|
|
|
if (!wav_file->CanRead())
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1999-08-15 06:28:21 -04:00
|
|
|
wav_file->Play();
|
|
|
|
frame->Show(TRUE);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
IMPLEMENT_APP(MyApp)
|