Search code examples
javascriptnode.jsgoogle-cloud-platformgoogle-cloud-storage

in nodejs How do I get audio duration for a audio file in google cloud storage without downloading?


In Node.js How do I get audio duration for an audio file in google cloud storage without downloading ?


Solution

  • Google Cloud Storage just stores the raw bytes of any files or objects you upload. It makes no attempt to understand that format or meaning of the data you're putting in them. So you won't be able to ask it to understand things such as the duration or other properties of the audio (or any other type of content).

    If you want information about some content readily available without downloading the contents of the object, you could instead use custom metadata to store the specific data you need quick access to. Then you can just request the metadata alone without downloading the content. It's up to you to determine what to store and how to compute it.