FDWaveformView 0,0,1,0 travis-ci CocoaPods

Reads an audio file and displays the waveform

2 years after MIT

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.

let thisBundle = Bundle(for: type(of: self))
let url = thisBundle.url(forResource: "Submarine", withExtension: "aiff")
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 = true
self.waveform.doesAllowStretch = true
self.waveform.doesAllowScroll = true

Supports animation for changing properties:

UIView.animate(withDuration: 0.3) {
    let 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 iOS8+ and Swift 3.

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

Related Repositories

IQAudioRecorderController

IQAudioRecorderController

A drop-in universal library allows to record audio within the app with a nice Us ...

IQAudioRecorderController

IQAudioRecorderController

A drop-in universal library allows to record audio within the app with a nice Us ...


Top Contributors

fulldecent haydenholligan andreamazz simonbs solomon23 msching jakobsa protikhonov saiday rFlex digitalfx mheist09

Releases

-   v0.3.2 zip tar
-   v0.2.2 zip tar
-   v0.2.1 zip tar
-   v0.2.0 zip tar
-   v0.1.2 zip tar
-   v0.1.1 zip tar
-   2.0.0 zip tar
-   1.0.2 zip tar
-   1.0.1 zip tar
-   1.0.0 zip tar
-   0.3.1 zip tar
-   0.3.0 zip tar
-   0.1.0 zip tar
-   0.1 zip tar