I simply need to know when the user starts talking into the microphone. I will not be doing any speech processing or anything fancy, just detect when the microphone has picked up anything. I've been looking for an hour now and can't find anything as simple as that. Can somebody point me in the right direction?
Update 1
I apologise for how late this is; I have been having connectivity issues. Here's the code I've been using:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let audioEngine = AVAudioEngine()
let inputNode = audioEngine.inputNode
let bus = 0
inputNode.installTapOnBus(bus, bufferSize: 8192, format:inputNode.inputFormatForBus(bus)) {
(buffer: AVAudioPCMBuffer!, time: AVAudioTime!) -> Void in
println("Speech detected.")
}
audioEngine.prepare()
audioEngine.startAndReturnError(nil)
}