简体   繁体   English

如何使用AVAudioRecorder暂停和恢复录音

[英]How to pause and resume audio recording using AVAudioRecorder

I need to pause and then resume an audio recording, I'm using AVAudioRecorder for my recording sessions... Anyone knows how to do this? 我需要暂停然后恢复录音,我正在使用AVAudioRecorder进行录音会话......有谁知道怎么做? Any help will be higly appreciated! 任何帮助将非常感谢! Thanks a lot Peace Massy 非常感谢Peace Massy

After initializing and creating an object of AVAudioRecorder , lets say AVAudioRecorder *recorder , simply call [recorder record] to record and [recorder pause] to pause. 在初始化和创建AVAudioRecorder的对象AVAudioRecorder ,让我们说AVAudioRecorder *recorder ,只需调用[recorder record]进行记录, [recorder pause]暂停。

If you are calling record and pause in separate method eg on click of different buttons then you need to make recorder a class level variable. 如果您在单独的方法中调用记录和暂停,例如单击不同的按钮,则需要使recorder成为类级变量。

To pause the recording, use the following methods on AVAudioRecorder : 要暂停录制,请在AVAudioRecorder上使用以下方法:

- (void)pause

and to resume, use: 并恢复,使用:

- (BOOL)record

It's all here in the docs... 这一切都在这里的文档...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM