Skip to content

About

Audio waveform view with playback functionality, like Soundcloud

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

ASWaveformPlayerView

Swift5 compatible SPM compatible

Example

Check example project inside

Requirements

Swift 5

Description

ASWaveformPlayerView

A UIView subclass that displays waveform of a provided local audio file.

This view has 2 gesture recognizers attached:

  1. UITapGestureRecognizer - Play - Pause associated with a view audio file.
  2. UIPanGestureRecognizer - Seek audio file to specified position.

There are 3 public properties:

  • normalColor - default color of waveform, fills section of waveform that is yet to be played.
  • progressColor - already played section of waveform has this color.
  • allowSpacing - inserts a little spacing between bars in waveform.

Usage

Example:

      let waveform = try ASWaveformPlayerView(audioURL: audioURL, // URL to local a audio file
                                              sampleCount: 1024, // higher numbers makes waveform more detailed
                                              amplificationFactor: 500) // constant that affects height of each 'bar' in waveform

      waveform.normalColor = .lightGray
      waveform.progressColor = .orange
      //with high sampleCount passed to init method to avoid artifacts set this to false
      waveform.allowSpacing = false

Author

Alexey Savchenko, alexey.savchenko.home@gmail.com

License

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

About

Audio waveform view with playback functionality, like Soundcloud

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages