nickdesaulniers / audiostream Goto Github PK
View Code? Open in Web Editor NEWStream and transcode your music library over HTTP
Stream and transcode your music library over HTTP
Should we write this as two logical applications? The first being the audiostream application itself, providing an API to control it. Then the web interface as a second app that just uses the API?
This opens up the app to have other UI contributions, and separates out logic for us.
You can just make the main app be a dependency of the webapp so they can still deploy together. Just a thought.
This package is amazing:
node-fluent-ffmpeg
For this, I would like the path to be changed from:
/transcode/filename.extension
to /transcode/requested_container/filename.extanesion
.
Based on browser support, it looks like AAC is the next choice (or mp3, which would be the case of no transcoding, could make that a separate issue). So feature detection is needed client side to modify the requested path. This site has what we need: http://diveintohtml5.com/everything.html
Also, the transcode action on the server needs to update the command to run, swapping out the libvorbis argument. You can test that by getting a list of supported codecs:
ffmpeg -codecs
and finding the encoder name (on the right) for the container (also on the right), for audio encoding (symbols E and A on the left).
Hello,
is it possible to seek in audio files , or return the audio from a specific point of time in the file ?
Add the duration to the info sent to the client. This can not be read from the metadata tags, so I'm not sure how to implement this. Can be done client side, but that requires loading each audio file.
Right now there is no limit to how many concurrent calls are made to ffmpeg.ffprobe. If you are reading the tags of a large library for the first time, the node process will crash due to requesting too many file handles.
I brought this up to the node-fluent-ffmpeg people and they said to "not my problem", so I plan on submitting a pull request which wraps the calls in async.queue to fix this issue.
Just incase you haven't seen it yet:
http://devcomo.2013.nodeknockout.com/
Someone compile ffmpeg with emscripten. Wasn't sure how to let you know since you aren't on FB anymore :P
On Mac OSX Mountain Lion, while google chrome and firefox are ok, safari does not play the audio streams.
Chrome seems to load http://a.b.c.d:3000/transcode/ogg/17957156
while safari loads http://a.b.c.d:3000/transcode/mp3/17957156
The original audio file is a mp3.
or atleast metadata readable by musicmetadata
leetreveil/musicmetadata#13
So this causes the index listing to hang, since it's waiting for the last files metadata event.
Hashing the ajax response doesn't guarantee the resulting JSON from the server is in the same order. Sorting the results would also suck. Maybe keep track of the watched folders' mtime.
and add npm install
to readme. This will help reduce the repo size.
http://stackoverflow.com/a/11460324/1027966
Can't really verify right now, but seems like filenames that have a ".\ " in them aren't being listed. Ex. "01.\ Papercut.flac"
It's probably more responsive to serve a static html index page, then request the file data as json.
So we currently transcode if the file format is for example mp3 but they don't support mp3.
If they support the file format, serve the original non transcoded version. Dropping a symlink in the library/ can help.
Currently a fresh install of audiostream breaks because it grabs the most recent express, which has been drastically reconfigured. Updating to run with express 4 is pretty easy and should only involve some changes in app.js. I'm happy to do the work and submit a pull request.
Keep track of currently playing song client side, listen for ended event, nextSong.play(), update currently playing song. Maybe have a toggle button to keep playing?
...since it's not being used.
Now that I have an android device, I see that something is not working in Firefox for android. Investigation needed.
The tables are implemented with jquery data tables, http://datatables.net/styling/
And the page says jukebox instead of audio stream.
This is super easy, just add flac in the list of supported extensions regex in lib/filemap.js
I verified this works, but on a different machine that I don't want to have commit rights, so someday I'll get around to it, unless someone beats me to it!
$ npm empty
Deletes all files in /library
except the .gitignore and the folder itself.
https://npmjs.org/doc/scripts.html
Is it possible to specify the node and npm versions in the package.json?
Perhaps as
"engines": {
"node": "0.8.12",
"npm": "1.1.49"
}
For people who run different versions of node and because express doesn't work with node versions that are under 0.5.0.
Store listing in localstorage as well as oldest ctime of the folders. On page load, draw tables from localstorage data, and update in background or just call /list.
Template Literal is fastest, smallest and simplest template engine, because it use JS's literal template feature.
It's 55 times faster than EJS, and it also use less CPU and RAM ressources, so it may be a good idea to use it instead of EJS ๐
Add shuffle to randomly choose a song. Should be an external request, that way when pagination is implemented, it works.
It would be nice to be able to add new directories to the list of paths to search for media from the web.
In fact it would be nice to have some kind of interface to the config options in general.
kind of stupid, since the filemap is not updated...so no new files are ever parsed, not like their metadata is likely to change between requests,
Seen on Firefox - The player attempts to play mp3 files as ogg, which returns an error to the node console but does not notify the browser of this error.
https://github.com/nickdesaulniers/audiostream/blob/master/routes/index.js#L31
files.push({
key1: val1 || sane_default,
key2: val2 || sane_default
});
I believe it's faster for the vm to create a new objects rather than box and unbox an existing object by deleting and adding keys. Micro optimization? Maybe. But it's better to follow best practices. ;)
not sure what the iphone is doing but I don't think the canplay event is firing and progress tags are unsupported.
Currently, there is no file structure preservation or unique id's for songs, so if two songs with the same filename are requested, the second cannot be placed in library/
A file manager class, or separate process might be nice.
So I don't know too much about these formats. We will be converting to m4a, not aac since converted aac files don't seem to carry along metadata. But the current code does not index files other than mp3 ogg or wav:
e93f343#L0R5
looks like safari has trouble with HTTP basic authentication?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.