在播放音乐时录制语音-过滤扬声器输入(iOS) [英] Recording voice while playing music - filter speakers input (iOS)

查看:59
本文介绍了在播放音乐时录制语音-过滤扬声器输入(iOS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 Karaoke应用,您可以在其中录制声音并听音乐.当用户使用耳机时,一切都很棒-他可以边唱歌边听音乐,也可以戴着耳机听自己讲话.然后我们记录了他的纯净声音,可以将其与播放混合.用户不使用耳机时会发生问题.然后,我们通过扬声器 AVAudioSessionCategoryPlayAndRecord 播放音乐并同时录制.在最终录音中,我们将用户的声音和扬声器的播放混合在一起.问题在于播放的音量很大,并且正在覆盖"用户的声音.首先,我认为这是正常现象,因为扬声器靠近 microphone ,所以我无能为力.但是,当我在Garage Band上尝试相同的操作时,它会以某种方式降低扬声器的播放效果,从而使声音更加可听.我也在Instagram上尝试过(您可以在播放音乐的同时进行录音,例如从Spotify播放音乐),我注意到大约1秒钟之后.播放的音量正在减小,我们可以更精确地听到声音.我不认为这是后期处理,因为它会非常复杂,因此也许有一个选项可以让"iOS处理".需要明确的是-它不会降低录制过程中的播放速度-在收听最终视频时会完成".

I am developing an Karaoke app in which you can record your voice while listening to the music. When user uses headphones, everything is great - he can listen to the music and himself in headphones while singing. Then we have his pure voice recorded and we can mix it with playback. Problem occurs when user does not use headphones. Then we play music via speakers AVAudioSessionCategoryPlayAndRecord and record simultaneously. In final recording we have user's voice and playback from speakers mixed together. Problem is that playback's volume is very big and it's "covering" user's voice. Firstly I thought that this is normal behaviour because speakers are close to microphone so there is nothing I can do. However when I tried the same thing on Garage Band it somehow lowers playback from speakers making voice more hearable. I also tried it with Instagram (you can record while playing music e.g. from Spotify) and I noticed that after ~1 sec. playback's volume is decreasing and we can hear voice more precisely. I don't think that it's post processing because it would be very complicated so maybe there is an option to let "iOS handle it". To be clear - it does not lowers playback during recording - it's "done" while listening final video.

我使用 AVCaptureSession 进行录制,并使用 AudioKit Player 进行播放.

I use AVCaptureSession for recording and AudioKit Player for playing.

在此先感谢您的任何想法/提示/建议!

Thanks in advance for any thoughts/tips/advices!

致谢

推荐答案

好,所以我问Apple TS,响应正是我想要的:

Ok so I asked Apple TS and the respond was exactly what I wanted: https://developer.apple.com/documentation/avfoundation/avaudiosession/mode/1616455-voicechat You just have to set this mode in AVAudioSession and system will handle it device’s tonal equalization is optimized for voice

这篇关于在播放音乐时录制语音-过滤扬声器输入(iOS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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