Skip to content

Paperclip post-processor that generates a waveform image from audio files.

License

Notifications You must be signed in to change notification settings

atd/paperclip_waveform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paperclip Waveform

Paperclip Waveform is a Paperclip post-processor. It generates a png file with the waveform from an audio attachment, using the fantastic waveform gem github.com/benalavi/waveform

Usage

Waveform depends on ruby-audio, which in turn depends on libsndfile.

Build libsndfile from (www.mega-nerd.com/libsndfile/), install it via apt:

sudo apt-get install libsndfile1-dev

libsndfile in macports, etc…

ffmpeg is also required to convert original files to WAV

sudo apt-get install ffmpeg

Then add the gem to your Gemfile:

gem 'paperclip_waveform'

And the style to your audio:

class Audio < ActiveRecord::Base
  has_attached_file :file,
                    styles: { waveform: { format: :png, convert_options: { color: :transparent } } },
                    processors: [ :waveform ]

Take a look at github.com/benalavi/waveform/blob/master/bin/waveform for available options

About

Paperclip post-processor that generates a waveform image from audio files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published