• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    Objective-C
  • Created over 15 years ago
  • Updated over 13 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple class for listening to microphone levels, suitable for the iPhone.

Please Note! This Library Is Deprecated!

Please don't use this library anymore. It was a good run, though. We had some laughs and it was easy for the iPhone to hear them.

This code has been deprecated in favor of Apple's built-in solution, available since iOS 3.0: AVAudioRecorder.

Mobile Orchard published a nice tutorial.

SCListener 1.0.1

A simple class for listening to microphone levels, suitable for the iPhone.

Usage

#import "SCListener.h" // Remember to link to AudioToolbox.framework.

// Start listening.
[[SCListener sharedListener] listen];

// Retrieve the average power.
[[SCListener sharedListener] averagePower];

// Retrieve the peak power.
[[SCListener sharedListener] peakPower];

// Hmm...we're using this guy a lot...
SCListener *listener = [SCListener sharedListener];

// We can temporarily stop returning levels
[listener pause];
[listener listen]; // Quick.

// Or free up resources when we're not listening for awhile.
[listener stop];
[listener listen]; // Slower.

// Advanced!:
//
// If you're using the average and the peak, fetch both at once.
if (![listener isListening]) // If listener has paused or stopped...
  return;                    // ...bail.

AudioQueueLevelMeterState *levels = [listener levels];
Float32 peak = levels[0].mPeakPower;
Float32 average = levels[0].mAveragePower;

License

(c) 2009-* Stephen Celis, [email protected].

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

SQLite.swift

A type-safe, Swift-language layer over SQLite3.
Swift
9,718
star
2

ghi

GitHub Issues on the command line. Use your $EDITOR, not your browser.
Ruby
2,135
star
3

syn

Syntax control for the command line
Objective-C
377
star
4

timeframe

Click-draggable. Range-makeable. A better calendar.
JavaScript
287
star
5

Formatting

Type-safe, functional string formatting in Swift.
Swift
248
star
6

app

Easy App config.
Ruby
97
star
7

haddock

A more memorable password generator.
Ruby
88
star
8

githubbub

GitHubbub: A GitHub Fluid userscript. Growl/Dock notifications, and more.
JavaScript
84
star
9

minifacture

factory_girl for minitest
Ruby
69
star
10

BRLOptionParser

A short wrapper for getopt_long(3). Command line options parsing for Objective-C.
Objective-C
50
star
11

acts_as_singleton

A lightweight singleton library for your Active Record models.
Ruby
47
star
12

rdoctest

A doctest for Ruby. Parses RDoc text for examples and tests them.
Ruby
37
star
13

SQLiteCipher.swift

SQLite.swift + SQLCipher
Swift
33
star
14

dots

Free progress dots for your scripts. Test::Unit-style.
Ruby
33
star
15

vim-mml

Music Macro Language (MML) VIM plug-in. Edit, compile, and play NES chiptunes.
C
31
star
16

dotfiles

gone fishing
Ruby
26
star
17

rerails

Reinforcing the Rails with assorted patches.
Ruby
21
star
18

kvc

KVC (Key-Value Configuration): a powerful, transparent way to maintain mutable app settings in the database.
Ruby
14
star
19

ScreenshotWatcher

A demonstration of testing uncertainty in Swift Concurrency
Swift
7
star
20

scantron

Rule-based string scanning and scrubbing.
Ruby
7
star
21

Gestures.swift

iOS block-based gesture helpers.
Swift
7
star
22

EnumRuntimeBug

Swift
2
star
23

gorilla

Unit conversion for the underdog.
Ruby
2
star
24

actionview-data

HTML5 data attribute helpers for ActionView.
Ruby
1
star
25

swift-remove-first-benchmark

Swift
1
star
26

Platformer

Playing with Flixel.
ActionScript
1
star
27

scptest

Swift
1
star
28

CSQLite

System module for sqlite3
Swift
1
star
29

ghi-playground

Nothing to see here, folks.
1
star