No commit activity in last 3 years
No release in over 3 years
Paperclip Waveform is a Paperclip post-processor that creates a png file with the waveform of the audio attachment .
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 0.1.2
 Project Readme

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