使用AVAudioRecorder记录AVAudioPlayer输出 [英] Record AVAudioPlayer output using AVAudioRecorder

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

问题描述

在我的应用中,用户可以通过按下按钮来播放声音。有几个按钮可以同时播放。使用AVAudioPlayer实例播放声音。我想使用AVAudioRecorder记录这些实例的输出。我已经设置了所有内容并创建了一个文件并进行了录制,但是当我播放它时它不播放任何声音。这只是录音长度的静音文件。有没有人知道AVAudioPlayer或AVAudioRecorder是否有设置?谢谢

In my app the user plays a sound by pressing a button. There are several buttons which can be played simultaneously. The sounds are played using AVAudioPlayer instances. I want to record the output of these instances using AVAudioRecorder. I have set it all up and a file is created and records but when I play it back it does not play any sound. It is just a silent file the length of the recording. Does anyone know if there is a setting I am missing with AVAudioPlayer or AVAudioRecorder? Thanks

推荐答案

无法将AVAudioPlayer输出记录为AVAudioRecorder的输入以进行录制。您可以使用音频缓冲区存储播放的文件并将其保存到文件中。

It is not possible to record AVAudioPlayer output as input to AVAudioRecorder for recording. You can use audio buffer to store played files and save it to a file.

这篇关于使用AVAudioRecorder记录AVAudioPlayer输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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