Audioproxy Gem Enables On-Demand Audio Transcoding in Rails Without Background Jobs
A Ruby gem called Audioproxy allows Rails developers to generate signed, cached audio preview URLs directly from Active Storage attachments without needing a job queue. The tool encodes format options, bitrate, and source URI into a signed URL path, with the first page load triggering transcoding and all subsequent requests served from a variant cache. It supports a range of processing options including trimming, fading, normalization, and expiry, all baked into the signed URL. Waveform peak data can also be generated as a format type, ensuring the visual waveform always matches the processed audio variant. The gem raises descriptive errors for unattached files or unknown options, reducing the risk of silent failures in production.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in