bbc / audiowaveform

C++ program to generate waveform data and render waveform images from audio files
https://waveform.prototyping.bbc.co.uk
GNU General Public License v3.0
1.94k stars 242 forks source link

Help: Running from a firebase cloud function #182

Open Toolenaar opened 1 year ago

Toolenaar commented 1 year ago

Hi I would like to run this from a firebase cloud function (node), where it fetches an audiofile from a storage bucket and generates the waveform data. But I have no clue where to start, would this even be possible ? Can anyone nudge me into the right direction? Any help is really appriciated

chrisn commented 1 year ago

I don't know anything about Firebase, but the general steps would be:

  1. Install audiowaveform (e.g, as described in https://github.com/bbc/audiowaveform#installation). If this is anything like AWS Lambda, though, you'll need to compile and upload a statically linked build of audiowaveform suitable for whatever OS Firebase uses, together with your Node.js code
  2. Write a Node script to fetch the audio file, run it through audiowaveform, then store the waveform data somewhere, presumably to another storage bucket
JacobJaffe commented 1 year ago

@Toolenaar Have you had any success with this? I'm looking into doing something similar.

From what I can tell, Firebase Functions have a defined set of system packages that will be installed, that can't be changed: https://cloud.google.com/functions/docs/reference/system-packages

I'm thinking of setting up a micro service with the more flexible Cloud Run, which could have access to storage / be called from a function: https://cloud.google.com/workflows/docs/run/tutorial-cloud-run

clawvyrin commented 2 months ago

Hey 👋, has any of you found a way to do it ? Would like to do the same but i'm kinda stuck