https://github.com/tomasc/dragonfly_audio
Wraps common audio-related tasks into Dragonfly analysers and processors.
https://github.com/tomasc/dragonfly_audio
Last synced: 7 months ago
JSON representation
Wraps common audio-related tasks into Dragonfly analysers and processors.
- Host: GitHub
- URL: https://github.com/tomasc/dragonfly_audio
- Owner: tomasc
- License: mit
- Created: 2015-10-15T16:30:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-09-02T19:00:33.000Z (10 months ago)
- Last Synced: 2025-10-11T09:05:42.275Z (8 months ago)
- Language: Ruby
- Homepage:
- Size: 5.95 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Dragonfly Audio
[](https://travis-ci.org/tomasc/dragonfly_audio) [](http://badge.fury.io/rb/dragonfly_audio) [](https://coveralls.io/r/tomasc/mongoid_recurring)
Wraps common audio-related tasks into [Dragonfly](http://markevans.github.io/dragonfly) analysers and processors.
## Installation
Add this line to your application's Gemfile:
gem 'dragonfly_audio'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dragonfly_audio
## Dependencies
This gem uses [taglib-ruby](https://github.com/robinst/taglib-ruby) to read and write meta data and properties of audio files.
## Usage
Add the `:audio` plugin to your Dragonfly config block:
```ruby
Dragonfly.app.configure do
plugin :audio
end
```
## Supported Formats
List of supported formats is available as:
```ruby
DragonflyAudio::SUPPORTED_FORMATS # => ["aif", "aiff", …]
```
## Analysers
### audio_properties
Reads properties and tags of an audio file:
```ruby
audio.audio_properties
# => {
# title: 'The Ship Was Sailing',
# artist: 'Vito Ricci',
# album: 'Music From Memory',
# year: '1985',
# track: 7
# genre: 'Ambient',
# comment: 'This Music was originally composed for "The Memory Theatre of Gulio Camillo" by Matthew Maguire. A Creation production premiered at La Mama Spring 1985 thanks to Bonnie for not laughing to Justin for laughing to Jon Gordron for electronic bondage produced by Jonathan Mann for Pangea Productions recorded 8/85 at Chiens Interdits Studio in a big cover production by Ann Rower cover design by Paul Leone * all compositions by Vito Ricci * play it loud',
# length: 345,
# length_in_seconds: 345,
# length_in_milliseconds: 345000,
# bitrate: 192,
# channels: 2,
# sample_rate: 44_100
# }
```
## Processors
### tag
Sets the file's meta information:
```ruby
audio.tag(artist: 'Ariel Kalma', album: 'Le Temps Des Moissons', track: 'Bakafrika')
```
Permissible properties:
* album
* artist
* comment
* genre
* tag
* title
* track
* year
### album_art
Sets the file's album art:
```ruby
audio.album_art('path_to_file')
```
Note that this only works for mp3 files.
## Contributing
1. Fork it ( https://github.com/tomasc/dragonfly_audio/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request