TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Apr 2017 |
Maintained by Nikola Corlija.
Based on https://github.com/faviomob/FVSoundWaveDemo with improvements:
To run the example project, clone the repo, and run pod install
from the Example directory first.
Example:
NCSoundHistogram is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "NCSoundHistogram"
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];
}
NCSoundHistogram is available under the MIT license. See the LICENSE file for more info.