首页 > 解决方案 > AVAudioRecorder.pause() 在状态栏中显示红色麦克风图标

问题描述

我正在开发录音机应用程序,我使用 AVAudioRecorder 来录制音频。

https://www.hackingwithswift.com/example-code/media/how-to-record-audio-using-avaudiorecorder

一切正常。为了在应用程序处于后台时录制音频,我启用了“音频”背景模式。现在问题出现了。每当我停止录制时,即使应用程序现在处于前台,它也会在状态栏中显示红色麦克风图标不到 1 秒。 https://imgur.com/a/G9NTL4y

如果我禁用“音频”背景模式,则不会出现。

源代码:https ://github.com/nightbird8n/AudioRecorder

请帮我解决这个问题。谢谢

标签: iosswiftaudioavfoundationrecording

解决方案


推荐阅读