Получить звук с микрофона

Советы » Аудио » Получить звук с микрофона

Сначала надо создать пустой аудио файл, допустим Windows Audio Recorder, причем какие у него будут параметры, такие будут и у результирующего файла, затем с помощью var Media:TMediaPlayer

procedure TForm1.btRecordClick(Sender: TObject);
begin
  with Media do
  begin
    { Set FileName to the test.wav file to }
    { get the recording parameters. }
    FileName := 'd:	est.wav';
    { Open the device. }
    Open;
    { Start recording. }
    Wait := False;
    StartRecording;
  end;
end;

procedure TForm1.btStopClick(Sender: TObject);
begin
  with Media do
  begin
    { Stop recording. }
    Stop;
    { Change the filename to the new file we want to write. }
    FileName := 'd:
ew.wav';
    { Save and close the file. }
    Save;
    Close;
  end;
end;

Другое по теме:

Категории

Статьи

Советы

Copyright © 2023 - All Rights Reserved - www.delphirus.com