Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLAC support #7

Open
solarnz opened this issue Apr 14, 2015 · 3 comments
Open

FLAC support #7

solarnz opened this issue Apr 14, 2015 · 3 comments

Comments

@solarnz
Copy link
Contributor

solarnz commented Apr 14, 2015

I would like flax support because I am a lossless audio snob.

@dhowden
Copy link
Member

dhowden commented Apr 14, 2015

FLAC support is in the pipeline.

Currently working on a patch to add FLAC support to the metadata reading library https://github.com/dhowden/tag.

Once that's done the plan is to get FLAC files playing in the UI using https://github.com/audiocogs/flac.js. Then at some point in the future would port that code to Go so that we can decode and stream PCM (or MP3 depending on the connection speed) directly to the frontend from the server.

@solarnz
Copy link
Contributor Author

solarnz commented Apr 16, 2015

So to use flac.js, you need to use their framework and their audio player - see https://github.com/audiocogs/aurora.js/wiki/Getting-Started

This may also solve some of your other issues at the same time (It looks like it's using the Audio api's, rather than an audio element like you're currently using 👍 )

@dhowden
Copy link
Member

dhowden commented Apr 16, 2015

I was hoping to just use flac.js, ALAC.js, but then write a very simple wrapper to hook the PCM output into the Web Audio API (anticipating that this decoding work will be done on the server in the near future). There are several Web Audio API docs which seem to suggest that this would be quite straightforward.

This would also fit nicely with the current approaches I've seen to gapless playback with the Web Audio API (though I have yet to properly experiment with that).

A nice compromise in the short term would be to use their full player (assuming the events stuff can all be hooked in nicely). In the long term there are a few issues in the project which are a bit worrying:

  1. Streaming: having to wait for the whole file to download before playing. Seems to be non-trivial to debug. Waiting for a full FLAC/ALAC file to be fetched from a remote store before it could start playing would be very frustrating. However, it seems that you can fix these problems by using Websockets - need to play with that!
  2. Gapless playback doesn't seem to work (which is somewhat of a deal breaker for me). See Gapless audiocogs/aurora.js#85.

I've been experimenting with a branch which uses the JS Audio object (an equivalent of the <audio> tag), which is working quite nicely. Amongst other things it allows for some prefetching without having to stop React clobbering the <audio> and any pre-fetched buffer that comes with it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants