Kylix
Tips

NEW TIPS
Database (135)
Files (612)
Forms (606)
Graphic (536)
IDE (456)
Indy (433)
Internet / LAN (590)
IntraWeb (443)
Kylix (447)
Math (561)
Misc (591)
Multimedia (496)
Objects/
ActiveX (503)

OpenTools API (438)
Printing (459)
Strings (583)
System (721)
VCL (586)

Search Tip
Top15
Add new Tip

Forum

...record wave files (*.wav)?
Author: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch
[ Print tip ]    

Tip Rating (8):  
     



uses mmSystem;

{....}

procedure TForm1.Button1Click(Sender: TObject);     // Record
begin
  
mciSendString('OPEN NEW TYPE WAVEAUDIO ALIAS mysound', nil, 0, Handle);
  mciSendString('SET mysound TIME FORMAT MS ' +     // set time
    
'BITSPERSAMPLE 8 ' +                // 8 Bit
    
'CHANNELS 1 ' +                     // MONO
    
'SAMPLESPERSEC 8000 ' +             // 8 KHz
    
'BYTESPERSEC 8000',                // 8000 Bytes/s
    
nil, 0, Handle);
  mciSendString('RECORD mysound', nil, 0, Handle)
end;


procedure TForm1.Button2Click(Sender: TObject);     // Stop
begin
  
mciSendString('STOP mysound', nil, 0, Handle)
end;


procedure TForm1.Button3Click(Sender: TObject);      // Save
var 
  
verz: String;
begin
  
GetDir(0, verz);
  mciSendString(PChar('SAVE mysound ' + verz + '/test.wav'), nil, 0, Handle);
  mciSendString('CLOSE mysound', nil, 0, Handle)
end;

 

More Links to this topic
http://www.undu.com/Articles/010323d.html


Rate this tip:

poor
very good


Copyright © Torry's Delphi Pages Torry's Delphi Pages Maintained by Simon Grossenbacher Notes? Comments? Feel free to send... Copyright © 1996-2001