How to Change "capturing voice quality" in delphi firemonkey

  

I need to change captured voice quality programmatically to reduce file size , because of if I use default setting and start capturing voice it will reduce wave file that 1 minute recorded = more than 20 MB , so I need to change the quality of recording sitting to reduce file size.

Nothing found to tried , the code is worked well , but I need only to decrease recorded file size, by changing the quality of recording voice setting.

procedure TForm1.RecordButtonClick(Sender: TObject);
begin
// Get the default microphone
try
Mic := TCaptureDeviceManager.Current.DefaultAudioCaptureDevice;
if Mic <> nil then
begin
// Set the SaveDialog filter to choose only the supported extension
SaveDialog1.Filter := Mic.FilterString;
if SaveDialog1.Execute then
begin
RecordButton.Enabled := false;
StopButton.Enabled := true;
// Gets the name of the file where to save the recorded data
Mic.FileName := SaveDialog1.FileName;
Mic.StartCapture;
end;
end
else
begin
ShowMessage(‘Audio capturing device not available’);
end;
except
on E: Exception do
ShowMessage(E.Message);
end;
end;

procedure TForm1.StopButtonClick(Sender: TObject);
begin
try
if (Mic <> nil) and (Mic.State = TCaptureDeviceState.Capturing) then
begin
Mic.StopCapture;
StopButton.Enabled := false;
RecordButton.Enabled := true;
end;
except
on E: Exception do
ShowMessage(E.Message);
end;
end;

Comments are closed.