Latest 0.1.7
Homepage https://github.com/nikola9core/NCSoundHistogram
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

Based on https://github.com/faviomob/FVSoundWaveDemo with improvements:

  • Added playing animation
  • More customizations such setting bar line width

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Example:

alt tag

Requirements

  • iOS 8 sdk

Installation

NCSoundHistogram is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "NCSoundHistogram"

Usage

Import header

#import "NCSoundHistogram.h"

Initialize NCSoundHistogram and add as a view

- (void)viewDidLoad {
    [super viewDidLoad];

    NCSoundHistogram *soundHistogramView = [[NCSoundHistogram alloc] initWithFrame:CGRectMake(50, 50, 200, 100)];

    soundHistogramView.waveColor = [UIColor blueColor];
    soundHistogramView.animationColor = [UIColor cyanColor];
    soundHistogramView.drawSpaces = YES;
    soundHistogramView.barLineWidth = 2.5;

    [self.view addSubview:soundHistogramView];
}

Set audio file on some button click or when view appears

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"audio.m4a" ofType:nil]];
    soundHistogramView.soundURL = url;

    [soundHistogramView animatePlayingWithDuration:4];
}

License

NCSoundHistogram is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NCSoundHistogram",
    "version": "0.1.7",
    "summary": "Generates discrete histogram view from audio file.",
    "description": "Subclass of UIView that renders discrete histogram view for a given audio file.",
    "homepage": "https://github.com/nikola9core/NCSoundHistogram",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Nikola Corlija": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nikola9core/NCSoundHistogram.git",
        "tag": "0.1.7"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "NCSoundHistogram/Classes/**/*"
}

Pin It on Pinterest

Share This