如何使用AVAudioRecorder恢复录制? [英] How to resume a recording using AVAudioRecorder?

查看:80
本文介绍了如何使用AVAudioRecorder恢复录制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个使用AVAudioRecorder类的应用程序.它的工作原理很不错,除了打来的电话.我按照苹果使用AVAudioRecorderDelegate方法的指南

I am writing an application that uses the AVAudioRecorder class. It works great except for when a phone call comes in. I am handling this per apple's guidelines of using the AVAudioRecorderDelegate methods

– (void) audioRecorderBeginInterruption:
– (void) audioRecorderEndInterruption:

它很好用,直到中断结束为止,我尝试通过再次调用record方法(根据文档)来恢复"记录.但是,它不会恢复我的录音,而是丢弃旧的录音,并在其位置开始全新的录音.如果有人发现了这个问题,或者它是苹果公司的AVAudioRecorder的错误,我一直无法找到解决该问题的方法.我真的希望我不必使用AudioQueues编写该代码.

It works great until the interruption ends and I attempt to "resume" the recording by calling the record method again (per the documentation). However it does not resume my recording but instead throws out the old one and starts up an entirely new one in its place. I have not been able to find a solution to this problem, if anyone has figured this out, or if it is a bug with apple's AVAudioRecorder please let me know. I really hope I do not have to write this using AudioQueues.

谢谢

推荐答案

看起来像是苹果API的错误.很好玩....

Looks like its a bug with apple's API. Great fun....

这是我们从支持通知单中收到的回复.

This was the response we received from a support ticket.

您描述的行为是一个错误,很遗憾,API中没有任何更改可以更改以实际添加到原始录制内容.中断导致仅捕获中断之后录制的音频.您可以尝试并在中断后停止录制,然后创建一个新文件,此后至少不会导致用户丢失任何信息,但结果将是两个单独的文件.

"The behavior you described is a bug and unfortunately there's nothing in the API that you can change to work around to actually append to the original recording. The interruption is resulting in capturing only the audio recorded after the interruption. You could try and stop the recording after the interruption then creating a new file after which would at least not cause the user to loose any information, but the result would be two separate files.

请针对此问题提交错误报告,因为当iOS工程评估评估修复的关键功能时,外部开发人员提交的错误至关重要.它很容易复制,但如果您有测试应用程序,则可以包括在内,iOS工程就像使应用程序直接显示该错误一样. "

Please file a bug report at for this issue since bugs filed by external developers are critical when iOS engineering is evaluating critical features of fixes to address. It's easily reproducible but if you have a test app you can include please do, iOS engineering like having apps that show the bug directly. "

这篇关于如何使用AVAudioRecorder恢复录制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆