Mega Code Archive

 
Categories / Delphi / Multimedia
 

Wav kayit

// Record procedure TForm1.Button1Click(Sender: TObject); begin mciSendString('OPEN NEW TYPE WAVEAUDIO ALIAS MicSound', nil, 0, Handle); // MicSound is what the WaveAudio is asigned to. // It is used in all the mciSendString so if you // rename it to a diffrent name then you need to // make sure you change it on all of them. // If you dont know what I just said.. // hell I dont think I know what i just said // then leave it the way it is, it will work ether way. // The Following is pritty much self explanatory but I put // the Notes out for those who dont follow. mciSendString('SET MicSound TIME FORMAT MS ' +// set the time format 'BITSPERSAMPLE 8 ' +// 8 Bit 'CHANNELS 1 ' + // MONO 'SAMPLESPERSEC 8000 ' + // 8 KHz 'BYTESPERSEC 8000', // 8000 Bytes/s nil, 0, Handle); mciSendString('RECORD MicSound', nil, 0, Handle); end; // Stop Record procedure TForm1.Button2Click(Sender: TObject); begin mciSendString('STOP MicSound', nil, 0, Handle); end; // Save Wave File procedure TForm1.Button3Click(Sender: TObject); begin mciSendString(PChar('SAVE MicSound ' + 'C:\FileName.wav'), nil, 0, Handle); mciSendString('CLOSE MicSound', nil, 0, Handle); end; { If you like the code then please vote. And if anyone finds a source for changing Wav to Mp3, Please let me know, I could realy use it. }