Back

GetMetadata

Hello World

Returns a string list of metadata values contained in an audio file.

app.GetMetadata( file, keys ) → String: comma “,” separated

See Also: CreateMediaPlayer

Example - Retreive all Metadata

function OnStart()
{
    app.ChooseFile( "Choose an audio file", "audio/mpeg", OnChoose );
}

function OnChoose( path )
{
    var keys = (
        "album,artist,genre,title,composer," +
        "author,duration"
        ).split(",");

    var data = app.GetMetadata( path, keys )
    data = data.slice(1).split(",");


    var lst = [];
    for(var i in keys) lst.push(keys[i] + ": " + data[i]);

    app.Alert( lst.join( "\n" ), path );
}
    Copy     Copy All       Run      
String: path to file ( “/absolute/...” or “relative/...” )
String: comma “,” separated: “album”, “artist”, “genre”, “title”, “composer”, “author”, “duration”, “bitrate”, “width”, “height”