12

I'm trying to access sound volume data from the microphone in realtime. I've tried AVAudioPlayer but it only monitors sounds from a source like an mp3 and not from a microphone. I've also tried The SpeakHere app but it's proving to be much tougher to understand with all the Objective C++ syntax (i'm a newbie). Is there another class similiar to the one in SpeakHere but written only in Objective C?

picciano
  • 22,341
  • 9
  • 69
  • 82
Manny
  • 169
  • 1
  • 1
  • 5

2 Answers2

7

sc_listener is deprecated. The correct answer today is to use AVAudioRecorder. This tutorial explains how to use it.


Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Erik B
  • 40,889
  • 25
  • 119
  • 135
6

Erik's answer is correct. Here is a reusable implementation using this method as a recognizer/delegate.

https://github.com/picciano/iOS-Audio-Recoginzer

picciano
  • 22,341
  • 9
  • 69
  • 82
  • 2
    can we get the decibel(dB SPL) value of microphone, with your project? – brush51 Jun 12 '13 at 07:56
  • It includes the power levels, but I've read too many conflicting theories on exactly how to calculate the dB levels. I choose to leave that exercise to the reader. :) – picciano Jun 14 '13 at 01:18
  • Can [AVAudioSession](https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW42) – madLokesh Feb 05 '14 at 11:58