node-paperclip-audio
This is a plugin that works with node-paperclip. I takes wav files and encodes them to mp3 and adds tags.
To install
sudo apt-get install lame
Or for windows, maybe try http://kb.madcapsoftware.com/mobile/Basic/Content/Mimic/General/GEN1004M_-_Installing_LAME_MP3_Encoder_on_Windows_Vista.htm ? I haven't tested the windows installation. If you are successful at installing lame on windows and want to help out, submit a pull request and I will add that information here.
npm install node-paperclip-audio --save
Here is an example of a model that uses the mongoose plugin.
const mongoose = ;const Schema = mongooseSchema;const Paperclip = ; const Track = title: String artist: String album: String year: String trackNumber: String genre: String; Track moduleexports = mongoose;
Here is an example of an express route that uses that Track model.
const express = ;const router = express; const Track = ;const middleware = middleware router
Title Artist Album Year Track Genre File
This module uses s3 by default, but can use a file system if you want. The example above is configured to use the file system. If you plan to use s3 you will need the following environment variables set the AWS_BUCKET, AWS_REGION, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
Contributing
If you'd like to contribute a feature or bugfix: Thanks! To make sure your fix/feature has a high chance of being included, please read the following guidelines:
- Post a pull request.
- Make sure there are tests! We will not accept any patch that is not tested. It's a rare time when explicit tests aren't needed. If you have questions about writing tests for paperclip, please open a GitHub issue.
And once there are some contributors, then I would like to thank all of the contributors!
License
It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
Copyright
© 2017 Scott Ballantyne. See LICENSE for details.