Giter Site home page Giter Site logo

fdwaveformview's Introduction

FDWaveformView Build Status

FDWaveformView is an easy way to display an audio waveform in your app. It is a nice visualization to show a playing audio file or to select a position in a file.

Usage

To use it, add an FDWaveformView using Interface Builder or programmatically and then just load your audio as per this example. Note: if your audio file does not have file extension, see this SO question.

NSBundle *thisBundle = [NSBundle bundleForClass:[self class]];
NSString *filePath = [thisBundle pathForResource:@"Submarine" ofType:@"aiff"];
NSURL *url = [NSURL fileURLWithPath:filePath];
self.waveform.audioURL = url;

Features

Set play progress to highlight part of the waveform:

self.waveform.progressSamples = self.waveform.totalSamples / 2;

Zoom in to show only part of the waveform, of course, zooming in will smoothly rerender to show progressively more detail:

self.waveform.zoomStartSamples = 0;
self.waveform.zoomEndSamples = self.waveform.totalSamples / 4;

Enable gestures for zooming in, panning around or scrubbing:

self.waveform.doesAllowScrubbing = YES;
self.waveform.doesAllowStretchAndScroll = YES;

Supports animation for changing properties:

[UIView animateWithDuration:0.3 animations:^{
    NSInteger randomNumber = arc4random() % self.waveform.totalSamples;
    self.waveform.progressSamples = randomNumber;
}];

Creates antialiased waveforms by drawing more pixels than are seen on screen. Also, if you resize me (autolayout) I will render more detail if necessary to avoid pixelation.

Supports ARC and iOS5+.

Includes unit tests which run successfully using Travis CI.

Installation

  1. Add pod 'FDWaveformView', '~> 0.2.0' to your Podfile
  2. The the API documentation under "Class Reference" at http://cocoadocs.org/docsets/FDWaveformView/
  3. Please add your project to "I USE THIS" at https://www.cocoacontrols.com/controls/fdwaveformview if you support this project

fdwaveformview's People

Contributors

fulldecent avatar simonbs avatar protikhonov avatar mrpronin avatar rflex avatar digitalfx avatar

Watchers

James Cloos avatar JXT 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.