GithubHelp home page GithubHelp logo

88oio / fdwaveformview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fulldecent/fdwaveformview

0.0 2.0 0.0 4.82 MB

Reads an audio file and displays the waveform

License: MIT License

Objective-C 90.16% Ruby 1.15% C++ 0.16% C 4.46% Shell 4.07%

fdwaveformview's Introduction

FDWaveformView

![CI Status](http://img.shields.io/travis/William Entriken/FDWaveformView.svg?style=flat) Version License Platform

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.doesAllowStretch = YES;
self.waveform.doesAllowScroll = 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 iOS7+.

Includes unit tests which run successfully using Travis CI.

Installation

  1. Add pod 'FDWaveformView' 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

digitalfx avatar fulldecent avatar mheist09 avatar msching avatar protikhonov avatar rflex avatar simonbs avatar

Watchers

 avatar  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.