【问题标题】:firemonkey audio capture setAudioSource failedfiremonkey 音频捕获 setAudioSource 失败
【发布时间】:2015-08-17 11:16:17
【问题描述】:

我正在复制 herehere 的代码以在 Android 手机上捕获音频。

...
 MyAudio : TAudioCaptureDevice;
  end;
var
  Form3: TForm3;
implementation
{$R *.fmx}
procedure TForm3.Button1Click(Sender: TObject);
begin
  if Button1.Text = 'Start Audio Capture' then begin
    MyAudio := TCaptureDeviceManager.Current.DefaultAudioCaptureDevice;
    if MyAudio <> nil then begin
    Button1.Text := 'Stop Audio Capture';
      MyAudio.FileName := 'TestAudio.mp3';
      MyAudio.StartCapture;
    end
    else
   // not copy // Caption := 'Audio capture devices not available.';
  end
  else begin
    MyAudio.StopCapture;
    Button1.Text := 'Start Audio Capture'
  end;
end;

错误提示:

java.lang.RunTimeException:
setAudioSource failed.

第二次点击button1时,提示:

java.lang.illegalStateException.

Here我找到了一些相关的帖子,但似乎是Java。

我正在 Android 4.4.2,delphi xe8 上进行测试。

可以在firemonkey中解决吗?

谢谢。

【问题讨论】:

    标签: delphi firemonkey


    【解决方案1】:

    我尝试修改清单文件以设置音频源进行了数小时的测试,但失败了。

    无意中找到了project-option-user权限,选择android平台,设置record audio true。有用。我不知道这是否是正确的做法。但它有效。这很简单,因为我不知道那个选项。

    用户权限包含大量信息来控制手机!

    我尝试在项目中的列表框的按钮和列表项中添加一些浮动动画。但似乎动画只适用于矩形或按钮,尽管我在选项中设置了 true。这可能是另一个应该在这里提出的问题。

    感谢观看。

    【讨论】:

      猜你喜欢
      • 2015-11-21
      • 2021-04-12
      • 1970-01-01
      • 1970-01-01
      • 2014-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多