FMX.MEDIA中的录音功能实现

  FMicrophone := TCaptureDeviceManager.Current.DefaultAudioCaptureDevice;
   if Assigned(FMicrophone) then
   begin
     FMicrophone.FileName := udpclients.tempsavepath + '\RecordTest.wav';
     try
       FMicrophone.StartCapture;
     
     except
      
       ShowMessage('设备不识别或不支持。');
     end;
   end
   else
     ShowMessage('没有可用的麦克风。');

 

if Assigned(FMicrophone) then    try     

     if FMicrophone.State = TCaptureDeviceState.Capturing then   

   begin        FMicrophone.StopCapture;

     end;    except

     ShowMessage('设备不识别或不支持');    end;

posted @ 2014-08-13 13:45  LAOS  阅读(567)  评论(0编辑  收藏  举报