www.pudn.com > audiocapture.zip > Sound1.cpp, change:2001-04-20,size:1613b


//--------------------------------------------------------------------------- 
#include <vcl.h> 
#pragma hdrstop 
 
#include "Sound1.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma resource "*.dfm" 
TForm1 *Form1; 
//--------------------------------------------------------------------------- 
__fastcall TForm1::TForm1(TComponent* Owner) 
  : TForm(Owner) 
{ 
  Stop->Enabled=false; 
  m_Frecuencia=4000; 
  m_Sample=8; 
} 
//--------------------------------------------------------------------------- 
 
 
void __fastcall TForm1::StartClick(TObject *Sender) 
{ 
  Audio=new CAudioCap(Edit1->Text.c_str(),m_Frecuencia,m_Sample); 
 
  Audio->Start(); 
  Start->Enabled=false; 
  Stop->Enabled=true; 
} 
//--------------------------------------------------------------------------- 
 
void __fastcall TForm1::StopClick(TObject *Sender) 
{ 
  Start->Enabled=true; 
  Stop->Enabled=false; 
  Audio->Stop(); 
} 
//--------------------------------------------------------------------------- 
 
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action) 
{ 
  delete Audio; 
} 
//--------------------------------------------------------------------------- 
 
void __fastcall TForm1::ComboBox1Change(TObject *Sender) 
{ 
  m_Frecuencia=StrToInt(ComboBox1->Text); 
} 
//--------------------------------------------------------------------------- 
 
void __fastcall TForm1::ComboBox2Change(TObject *Sender) 
{ 
  m_Sample=StrToInt(ComboBox2->Text);   
} 
//---------------------------------------------------------------------------