【发布时间】:2017-05-02 16:40:34
【问题描述】:
当使用蓝牙麦克风并记录 installTap 的输出时,我得到了高音调、非常快的播放。
使用蓝牙:
installTap -> 高音、快速播放
AVAudioRecorder -> 按预期正常
使用苹果的耳机麦克风:
installTap -> 按预期正常
AVAudioRecorder -> 按预期正常
知道为什么会这样吗?如果 AVAudioRecorder 能够按预期录制蓝牙输入,为什么我在通过 installTap 录制时会获得高音、快速的播放?
安装点击:
let format = mixer.outputFormat(forBus: 0)
let _bufferSize : AVAudioFrameCount = 4096
mixer.installTap(onBus: 0, bufferSize: _bufferSize, format: format) {
(buffer: AVAudioPCMBuffer!, time: AVAudioTime!) -> Void in
try self.outputFile.write(from: buffer)
}
输出文件:
try self.outputFile = AVAudioFile(forWriting: outputFile, settings: self._settings)
_设置:
let _settings = [
AVLinearPCMIsFloatKey: 1,
AVLinearPCMIsNonInterleaved: 1,
AVFormatIDKey: Int(kAudioFormatLinearPCM),
AVSampleRateKey: 44100,
AVNumberOfChannelsKey: 2,
AVLinearPCMBitDepthKey: 32,
AVLinearPCMIsBigEndianKey: 0,
AVEncoderAudioQualityKey: AVAudioQuality.low.rawValue
]
【问题讨论】:
标签: ios swift bluetooth audio-recording