Giter Site home page Giter Site logo

ammeter's Introduction

##AMMeter Audio Metering Class

AMMeter is an Objective-C Class that creates reusable audio metering objects.

###Features

  • Accepts gain float data and draws a meter
  • Fader with delegate callback to audio channels
  • Configurable Label Position
  • Configurable DB tick step size
  • Auto sizes elements to Frame size

Usage

Import included files into your project, and reference #import 'AMMeter.h' in your header. Instantiate the meter like you would a UIView

Example In your view controller :

_meter = [[AMMeter alloc]initWithFrame:CGRectMake(972, _waveFormView.frame.origin.y, 52, 720) lablesOnRightSide:YES andLowestDB:20];

In your Audio Engine or View Controller (depnding on how you have your app configured)

in.h

YourClass() <AMMeterDelegate>

in .m

_meter.delegate = self;

LabelsOnRight is a bool that decides if the labels are on the right side or left. Lowest DB is a setting that indicates the lowest visible DB in the meter.

Setting the delegate will let you use the slider to set the volume of an audio channel controleld by your audio engine.

Then you send amplitude information from the channel you are monitoring to the AMMeter instance. I do this with a runloop from an NSTimer, for example 60 times per second...

_playTimer = [NSTimer scheduledTimerWithTimeInterval:1/60 target:self selector:@selector(updateDB) userInfo:nil repeats:YES];
    [[NSRunLoop mainRunLoop] addTimer:_playTimer forMode:NSRunLoopCommonModes];

Then in my updateDB method: after getting my amplitude in DB from my chaneel (float)dbLevl variable

_meter.peakDB = dbLevel;

ammeter's People

Contributors

distraub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.