How to record microphone to MP3 with Delphi 10.4.2 on FMX Windows?

  

In FMX Delphi 10.4.2 I’m recording audio with this code:
var
fMicrophone: TAudioCaptureDevice;
begin

fMicrophone := TCaptureDeviceManager.Current.DefaultAudioCaptureDevice;

if fMicrophone = nil
then
begin
ShowMessage(‘Audio capturing device not available’);
Exit;
end;

MicFilterStringLabel.Text := fMicrophone.FilterString; // filter is *.wav

RecordButton.Enabled := False;
StopButton.Enabled := True;

// Sets the name of the file to save the recorded data
fMicrophone.FileName := TPath.Combine(gPreferences.TemporaryFolder, ‘samplefile.mp3’);

fMicrophone.StartCapture;
end;

// later the stop button calls fMicrophone.StopCapture;

This does not seem to create an authentic MP3 file. Perhaps it’s still making a WAV file but just with the MP3 extension.
Can this component make an MP3 file?
Failing that, is there a component that will make MP3 files? (The mitov components don’t seem to install on Delphi 10.4.2 and I don’t have an email answer back from him about that yet.)

Comments are closed.