Skip to content

gabriel-jones/iOS-Animated-Waveform-in-Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

iOS-Animated-Waveform-in-Swift

A waveform that animates to an AVAudioPlayer.

Installation

Drag WaveformView.swift into your project.

Usage

Create a view on a storyboard or in your code manually, and set its type as WaveformView.

To activate the waveform, write this code:

myWaveformView.start(&myAudioPlayer)

With myWaveformView being the view you created as the type of WaveformView above, and myAudioPlayer being the audio player you want the waveform to animate to.

Customization

Attribute Description Usage
color Chanes the color of the waveform waveform.color = UIColor(r: 0.6, g: 0.3, b: 0.1, a: 0.9)
waveform.color = myImage.averageColor()
randomColor Overrides color attribute to be a random color each frame waveform.randomColor = true
lineWidth Changes the width of the lines in the waveform waveform.lineWidth = 3.0

About

A waveform that animates to an AVAudioPlayer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages