Skip to content

Commit

Permalink
removed cruft, updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdesaulniers committed Nov 19, 2012
1 parent 9ccd68c commit c8c18f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -7,28 +7,28 @@ Stream and transcode your music library. The goal is to make software you want

### Requirements
* Unix variant OS (OSX, Linux, BSD, etc.)
* ffmpeg
* Node.js
* [ffmpeg](http://ffmpeg.org/download.html)
* [Node.js](http://nodejs.org/download/)
* NPM

Currently only Unix like operating systems are supported for the server. This is because audiostream uses Unix commands such as find and xargs, under the hood.
Currently only Unix like operating systems are supported for the server. Windows support has not yet been tested.
You need to install ffmpeg and have it in your path so that typing `which ffmpeg` in your command line produces an absolute path.
Node.js is used to demonstrate it can be the backend for awesome apps.

### Download source
`$ git clone git://github.com/nickdesaulniers/audiostream.git && cd audiostream && npm install`

### Configure
Modify `config/config.json` to add your music library's absolute paths. Notice how for paths with spaces, the spaces and parentheses needs to be escaped (a single backslash), and for JSON the escape character needs to be escaped (two backslashes). It would be nice to have part of the web interface handle this!
Modify `config/config.json` to add your music library's absolute paths. Notice how for paths with spaces, the spaces and parentheses needs to be escaped (a single backslash), and for JSON the escape character needs to be escaped (two backslashes).

### Run
`$ node app.js`
`npm start` or `$ node app.js`

### View
`$ open localhost:3000`

## Notes
* Click on any link to fetch a file. If the file has not yet been transcoded, it will be, then served, otherwise it serves the previously encoded version. The encoded files will be in `library/`.
* The app currently transcodes any file (well, tested only with mp3s) to the free and open source ogg container using the vorbis codec. It might be nice to add container support detection.
* The app currently transcodes a file (tested mp3's, and ogg's so far) to either ogg, mp3, aac, or wav based on browser support. If the original format is supported, then that file is served, otherwise a preferred format is transcoded to and served.
* HTTP Basic Authentication is currently being used, for it's simplicity. You can find the username and password in the `config/config.json` file. You need to restart the server if you modify the config file.

## Contributing
Expand Down
1 change: 0 additions & 1 deletion lib/filemap.js
Expand Up @@ -9,7 +9,6 @@ function escapejson (filename) {
return filename.replace(/\\/g, '');
}

// Make this a constructor next
var FileMap = {
retrieve: function (id) {
return file_dict[id];
Expand Down
8 changes: 0 additions & 8 deletions routes/index.js
@@ -1,16 +1,8 @@
var fs = require('fs');
var child_process = require('child_process');
var musicmetadata = require('musicmetadata');
var dirs = require('../config/config').music_folders.map(escapejson);
var FileMap = require('../lib/filemap').FileMap;

var supported_extension_re = /\.(mp3|ogg|wav|aac)$/;
var file_extension_re = /\.([0-9a-z]+)(?:[\?#]|$)/i;

function escapejson (filename) {
return filename.replace(/\\/g, '');
}

function escapeshell (cmd) {
return cmd.replace(/(["\s'$`\\\(\)])/g,'\\$1');
}
Expand Down

0 comments on commit c8c18f8

Please sign in to comment.