r/rails • u/DeltoidSchizachyrium • 17d ago
Gem I wrote an imgproxy-style proxy but for audio.
This is probably a quite niche topic, but since I often work with user provided audio, it bit me more then enough times. The problem in a nutshell is that ActiveStorage doesn't provide variants for anything other than images. But even if it did, it might be the wrong solution - in some situations, especially when audio is the product, you don't want every request for a media file go through your app server.
So I wrote AudioProxy, which transcodes on the fly. The proxy itself is written in Elixir, but that's an implementation detail. What matters is that I've made it deliberately simple to integrate with Rails.
Here's an article explaining how:
https://audioproxy.dev/blog/audio-previews-in-rails-without-a-job-queue/
-2
1
u/x1j0 16d ago
Pretty cool 👍