]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia2/sample/test_med4.cpp
1 // --------------------------------------------------------------------------
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
7 // --------------------------------------------------------------------------
10 #include <wx/wfstream.h>
12 #include "../lib/sndoss.h"
13 #include "../lib/sndwav.h"
14 #include "../lib/sndaiff.h"
15 #include "../lib/sndwin.h"
17 class MyApp
: public wxApp
{
18 wxSoundStream
*oss_dev
;
19 wxOutputStream
*f_output
;
20 wxSoundFileStream
*wav_file
;
23 wxFrame
*frame
= new wxFrame(NULL
, -1, "My Frame");
26 oss_dev
= new wxSoundStreamWin();
27 f_output
= new wxFileOutputStream(argv
[1]);
28 wav_file
= new wxSoundWave(*f_output
, *oss_dev
);
30 if (oss_dev
->GetError() != wxSOUND_NOERR
) {
31 wxPrintf("No device\n");
35 pcm
.SetSampleRate(22050);
39 wav_file
->SetSoundFormat(pcm
);
41 // Record 10 sec of sound