简体   繁体   English

如何使用AVAudioSession从音乐中删除/降低声音

[英]How to remove/volume down vocal from music using AVAudioSession

I am developing the app which required to Record audio when music is playing. 我正在开发需要在播放音乐时录制音频的应用程序。 I can successfully record sound with music. 我可以成功录制带有音乐的声音。 But I can't remove vocal from music. 但是我无法从音乐中删除人声。 It will also be great, if I can volume down of vocal when it rise. 如果我能在声音上升时调低声音,那也很棒。

I am using AVAudioSession, AVAudioPlayerNode for record while music playing. 我在播放音乐时使用AVAudioSession,AVAudioPlayerNode进行记录。

Any help will be appriaciated. 任何帮助将不胜感激。

In WWDC14 session #502 "AVAudioEngine in Practice" you could find how to configure AVAudioEngine for Karaoke which is good for your task and also you could find information about node tap. 在WWDC14会话#502“实践中的AVAudioEngine”中,您可以找到如何为卡拉OK配置AVAudioEngine ,这对您的任务AVAudioEngine ,并且您还可以找到有关节点抽头的信息。 Node tap can capture output from any AVAudioNode . 节点抽头可以捕获任何AVAudioNode输出。

So you could add node tap for you AVAudioInputNode and record all you need: 因此,您可以为AVAudioInputNode添加节点点击并记录所有需要的内容:

AVAudioInputNode *node = [engine inputNode];    
// add tap
[node installTapOnBus:0 bufferSize:4096 format[node outputFormatForBus:0] block:^(AVAudioPCMBuffer *buffer, AVAudioTime *when) {
    // save audio buffer
}];

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

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