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

查看:27
本文介绍了使用 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天全站免登陆