【问题标题】:Recording to a wav file录制到 wav 文件
【发布时间】:2014-02-10 18:00:53
【问题描述】:

我正在尝试使用 XE5 Firemonkey for Android 创建一个 wav 文件

从此链接:http://i-liger.com/article/android-wav-audio-recording

我读到我们必须忘记使用 MediaRecorder 类。

首先我们必须忘记 MediaRecorder 类。相反,我们 必须使用 AudioRecord,这个类提供了更多的灵活性。

如何在 XE5 中使用 AudioRecord?

【问题讨论】:

    标签: android delphi firemonkey delphi-xe5


    【解决方案1】:

    如果您在 XE5 安装中包含了示例,那么您在示例文件夹(通常在公共文档中)中有一个工作演示。查看 Samples\MobileCodeSnippets\Delphi\AudioRecPlay 文件夹。

    这是他们用来记录FMicrophone: TAudioCaptureDevice;的内容

    示例中的部分代码:

    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.');
    

    【讨论】:

    • 哦,我认为这适用于 .wav,我可能错了。我只是将 .caf 放入代码中,因为演示就是这样。
    • @Sentient:你试过用 .wav 扩展名吗?
    猜你喜欢
    • 2013-06-28
    • 2014-04-17
    • 2014-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多