Latest 0.5.0
Homepage https://github.com/rcholic/FDWaveformView
License MIT
Platforms ios 7.0, requires ARC
Frameworks AVFoundation, MediaPlayer, CoreGraphics
Authors

FDWaveformView

CI Status
Version
License
Platform
Carthage compatible

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 'FDWaveformViewForked' 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

Latest podspec

{
    "name": "FDWaveformViewForked",
    "version": "0.5.0",
    "summary": "Reads an audio file and displays the waveform",
    "description": "FDWaveformView is an easy way to display an audio waveform in your app.nIt is a nice visualization to show a playing audio file or to select a",
    "homepage": "https://github.com/rcholic/FDWaveformView",
    "screenshots": [
        "https://camo.githubusercontent.com/8c51361597e3c150cce6f60db5055663a7a7f8f1/68747470733a2f2f692e696d6775722e636f6d2f354e376f7a6f672e706e67",
        "https://camo.githubusercontent.com/3c21c8437f922ba6cb1a44b0701c02c140221d84/68747470733a2f2f692e696d6775722e636f6d2f665272486952502e706e67",
        "https://camo.githubusercontent.com/771973985f42a25931bfafba291f313ba8e46e32/68747470733a2f2f692e696d6775722e636f6d2f4a514f4b51336f2e706e67",
        "https://camo.githubusercontent.com/21e361bff1e2351a8f54636881c4290e4818501a/68747470733a2f2f692e696d6775722e636f6d2f386f52376370712e676966",
        "https://camo.githubusercontent.com/700a0eeb4bfbf5bab688dcb11ef60784b2074eef/68747470733a2f2f692e696d6775722e636f6d2f456778586143592e676966"
    ],
    "license": "MIT",
    "authors": {
        "William Entriken": "[email protected]"
    },
    "source": {
        "git": "https://github.com/rcholic/FDWaveformView.git",
        "tag": "0.5.0"
    },
    "social_media_url": "https://twitter.com/rcholic",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "public_header_files": "Pod/Classes/**/*.h",
    "frameworks": [
        "AVFoundation",
        "MediaPlayer",
        "CoreGraphics"
    ]
}

Pin It on Pinterest

Share This