Skip to content

hakanw/SCWaveformView

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SCWaveformView

A blazing fast customizable waveform view. Extract the audio section of an asset (which can be both video or audio) and display a waveform. Compared to other libs that are found on the web, this one does not do much memory allocations. Only one pass is also done to create the waveform.

Main features:

  • Can show a play progress
  • Colors are changeable at runtime without reprocessing the asset
  • Generated waveforms are retrievable
  • Set the asset, then you are good to go
  • ARC

This project is inspired from https://github.com/fulldecent/FDWaveformView

Podfile

If you are using cocoapods, you can use this project with the following Podfile

platform :ios, '7.0'
pod "SCWaveformView", "1.0.0"

Example

 // Allocating the waveformview
 SCWaveformView *waveformView = [[SCWaveformView alloc] init];
 
 // Setting the asset
 AVAsset *asset = [AVURLAsset URLAssetWithURL:[NSURL URLWithString:@"blabla.mp3"]];
 waveformView.asset = asset;
 
 // Setting the waveform colors
 waveformView.normalColor = [UIColor greenColor];
 waveformView.progressColor = [UIColor redColor];
 
 // Set the play progress
 waveformView.progress = 0.4;
 
 // Even though the waveformview will eventually reprocess the waveforms when needed
 // You can ask it to generate the waveforms right now
 [waveformView generateWaveforms];
 
 // Retrieve the waveforms. for whatever reasons
 UIImage *progressWaveformImage = waveformView.generatedProgressImage;
 UIImage *normalWaveformImage = waveformView.generatedNormalImage;

About

A blazing fast customizable waveform view

Resources

License

Stars

Watchers

Forks

Packages

No packages published