我正在开发一个带有多个 AVAudioPlayer 和一个 AVAudioRecorder 的 iPad 应用程序。这个想法是像背景音乐一样播放主要 AvAudioPlayer 的声音,并触摸不同的按钮播放其他 AVAudioPlayer 的声音以与背景音乐混合。混合音乐将由 AVAudioRecorder 录制。
为此,我使用 AVAudioSessionCategoryPlayAndRecord 类别实现了 AVAudioSession,并使用以下设置创建了 AVAudioRecorder 对象:
NSDictionary *recordSetting = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:kAudioFormatAppleIMA4], AVFormatIDKey,
[NSNumber numberWithInt:AVAudioQualityHigh], AVEncoderAudioQualityKey,
[NSNumber numberWithInt:16], AVEncoderBitRateKey,
[NSNumber numberWithInt: 2], AVNumberOfChannelsKey,
[NSNumber numberWithFloat:44100.0], AVSampleRateKey,
nil];
一切正常,但麦克风的输入也被记录了,这对我来说不好。
问题是,我如何在录音过程中忽略/替换/消除麦克风输入?
我在谷歌上搜索了很长时间,并在 Apple 文档中搜索 AVAudioSession 类别和模式、AVAudioRecorder 设置,但对我没有任何帮助。
我也搜索静音麦克风,但我读到这在 iOS 设备上是不可能的。
提前感谢您的帮助,并为我写英语的错误感到抱歉。