问题描述
System.Exception+ExceptionMessageKind.OutOfMemory 当我点击按钮录制音频时 如何处理和如何在 IOS 中扩展内存这可能编码它在 android 中工作正常,但不适用于 IOS 为录音机(如麦克风和内存)设置的所有权限。
` private async void bntRecord_Clicked(object sender,EventArgs e)
{
try
{
if (!recorder.IsRecording)
{
seconds = 0;
minutes = 0;
isTimerRunning = true;
Device.StartTimer(TimeSpan.FromSeconds(1),() =>
{
seconds++;
if (seconds.ToString().Length == 1)
{
lblSeconds.Text = "0" + seconds.ToString();
}
else
{
lblSeconds.Text = seconds.ToString();
}
if (seconds == 60)
{
minutes++;
seconds = 0;
if (minutes.ToString().Length == 1)
{
lblMinutes.Text = "0" + minutes.ToString();
}
else
{
lblMinutes.Text = minutes.ToString();
}
lblSeconds.Text = "00";
}
return isTimerRunning;
});
recorder.StopRecordingOnSilence = IsSilence.IsToggled;
var recordTask = await recorder.StartRecording();
bntRecord.IsEnabled = false;
bntRecord.BackgroundColor = Color.Silver;
bntPlay.IsEnabled = false;
bntPlay.BackgroundColor = Color.Silver;
bntStop.IsEnabled = true;
bntStop.BackgroundColor = Color.FromHex("#7cbb45");
await recordTask;
}
}
catch (Exception)
{
throw;
}
}`
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)