Compressing audio files using an express API

Hi everyone!

I’ve got a little technical challenge I’d like to share with you. On my website, built with the MEVN stack, my users can share music. When they upload an audio file, my Express API (written in TypeScript) with multer, allows me to retrieve the file via req.file , giving access to its Buffer via req.file.buffer .

Now, to store these audio files, I use Firebase Storage. But now I’m looking to compress these files to save space on my Firebase Storage.

I’ve looked for solutions like FFmpeg with ffmpeg-fluent, or SoX/LAME. But unfortunately, I’m on a free host where I don’t have access to administration, so it’s impossible to install FFmpeg on the server.

I’ve considered creating my own audio compressor, but I was wondering (given the very complex task) if there was a more elegant solution? Your ideas and suggestions are most welcome!

Thanks in advance for your answers and your invaluable help! :pray:

Hey, the work around here seems whether or not you could using a streaming format instead of storing on the cloud, again that might not be easy. You used to do things like compressing your entire hard drive etc… another thing that would be quite costly would to build your own server and run everything on your own. Good luck

More:

Google Drive File Stream is a way to stream files instead of using storage:

  1. File Stream creates a local copy of your drive on your computer.
  2. The virtual drive contains your drive and any Team Drives you may have access to.
  3. The drive does not take up physical storage space on your machine because all storage is in the cloud.
  4. Any changes you make are automatically synced with the cloud for quick, easy access anywhere you have an Internet connection.

Stream Files is the default setting in Google Drive for desktop. It allows you to access files in your drive on demand, and allows you to individually choose which ones you want to keep offline copies for.

With mirroring, you download a local copy of your entire Google Drive to your computer. Mirroring ensures the most recent changes made to any given file are on your computer and drive.

1 Like

Thanks you for your answer ! You’re right, it looks much better :slightly_smiling_face: