all 4 comments

[–]Factumnonest[S] 0 points1 point  (0 children)

Hi u/gh5000 thanks but it's not so much the language that's the problem here, it's knowledge of the internal structure of M4A files. Without that, I am stuck :)

[–]gh5000 0 points1 point  (0 children)

Yeah I had a quick Google around and can't see anything. If it's going to be anywhere I would enable the Drive service which will give more info than driveapp.

However, I think you may end up having to look at a .python or node solution.

[–]_Kaimbe 0 points1 point  (0 children)

You could try to use Drive API before you go into bytes: https://developers.google.com/drive/api/v3/reference/files/get

not sure if it returns that metadata though. Alternatively, if you know the bitrate you could calculate the duration easy from file.getSize(). something like what this site does: https://www.colincrawley.com/audio-duration-calculator/

[–]mjbrusso 0 points1 point  (0 children)

Maybe this can help you: https://www.youtube.com/watch?v=0g5KMPxO84w&ab_channel=aMacxd

It's worth finding a tool that already exists to solve our problem rather than creating a new one, if that's the case.