I'm trying to create a wav file using the XE5 Firemonkey for Android
from this link : http://i-liger.com/article/android-wav-audio-recording
I read that we must forget about using the MediaRecorder class .
First of all we have to forget about MediaRecorder class. Instead we have to use AudioRecord, this class providing more flexibility.
How can I use the AudioRecord in XE5 ?
If you included samples in your XE5 install than you have a working demo in samples folder (usually in the Public docuemnts). Look in the Samples\MobileCodeSnippets\Delphi\AudioRecPlay folder.
Here's what they use to record FMicrophone: TAudioCaptureDevice;
Some of the code in the sample:
FMicrophone := TCaptureDeviceManager.Current.DefaultAudioCaptureDevice;
if HasMicrophone then
begin
{ and attempt to record to 'test.caf' file }
FMicrophone.FileName := GetAudioFileName('test.caf');
try
FMicrophone.StartCapture;
except
ShowMessage('StartCapture: Operation not supported by this device');
end;
end
else
ShowMessage('No microphone is available.');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With