I'm trying to get the properties (e.g. its duration) of a MP3 file at a URL in a Google Apps Script. The following code gets an object, but as best I can tell, the resulting object is not an audio object.
function loadMusic(url) {
if (url == undefined) {
url = "http://traffic.libsyn.com/socialmediasec/Weekly_Blaze_E43.mp3";
};
var audio = UrlFetchApp.fetch(url).getAs("audio/mpeg");
return audio;
};
Doing this kind of thing in a webpage is simple using the Audio object (see W3Schools' documentation (link). Ideally, I would like to do something similar to this (link) except by referencing a URL instead of a DOM element. Is this possible?