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

On upload, convert audio file to AAC and store at https://beatsaver.com/storage/songs/{ID}/preview/{songname}.aac to support Beatsaver Viewer on Safari. #66

Open
ngokevin opened this issue Jan 14, 2019 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ngokevin
Copy link
Contributor

The BeatSaver Viewer allows previewing of BeatSaver songs in browser. This works for the most part.

However for iOS / MacOS, Safari does not support OGGs so we need to convert and upload an AAC as an alternative.

https://beatsaver.com/storage/songs/{ID}/preview/{songname}.aac

This issue is for doing this upon upload. Another script will be written separately for retroactively converting songs.

@luludotdev luludotdev added enhancement New feature or request help wanted Extra attention is needed labels Jan 14, 2019
@jetbalsa
Copy link

There are OGG decoders in pure JavaScript we can use for Safari

@ngokevin
Copy link
Contributor Author

ngokevin commented Jan 14, 2019

It could work (https://github.com/brion/ogv.js/), but we'd rather not have to have another codepath just for Safari since we're running all through Web Audio right now. Easiest and most robust for us would be official support. Alternatively, we could have a one-off server / endpoint convert OGG to AAC/MP3 on the fly, would just have to worry about uptime and pay for the instance.

@ngokevin
Copy link
Contributor Author

That path would be at

Storage::disk()->put("public/songs/{$song->id}/{$song->id}-{$songDetails->id}.{$songData['coverType']}", base64_decode($songData['coverData']));

  1. Extract audio file from ZIP
  2. Saving the audio file to a tmp path
  3. Calling ffmpeg -i tmp/song.ext storagePath/song.aac

I think that would also help the official BeatSaver site to preview audio file without pulling an emscripten library.

@ngokevin
Copy link
Contributor Author

Considering doing MP3 since Firefox does not support AAC outside an MP4 container. It will be nice to have a preview format that works across all browsers.

@sinfuljosh
Copy link

https://github.com/brion/ogv.js/

Wikipedia is able to play ogg using the above. Perhaps it can be used to bypass native iOS browser inability to play ogg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants