It's in the v2.9 patch we started rolling out last week. Most users should have it now.
To use, set the following attibute in your manifest:
requires_audiometadata=1
Interface: ifAudioMetadata
void SetUrl(url)
Set the URL to the audio file. Only file URL’s are initially supported.
Object GetTags()
Returns an associative array that contains a simple set of tags that are common to most audio formats. This associative array contains:
Object GetAudioProperties()
Returns an aa with a simple set of audio properties. These are values which may involve reading a larger portion of the file and thus may take longer to retrieve than the tags.
Object GetCoverArt()
Returns the covert art if available. Returns an aa with two entries: “bytes” and “type”. “bytes” is an roByteArray with the image data. “type” specifies the mime-type of image which is almost always either “image/jpeg” or “image/png”.
Looks for the picture designated as the cover art if there is more than one picture in the file. If there is no FrontCover picture then the first picture is used.
Example Code: roAudioMetadata
------------------------------------------------
REM printAA() is from generalUtils.brs in our sample apps
REM and used to print an associative Array
Sub SaveCoverArtFile(filename As String)
meta = CreateObject("roAudioMetadata")
meta.SetUrl(filename)
print "------------- GetTags() -------------------------"
tags = meta.GetTags()
printAA(tags)
print "------------- GetAudioProperties() --------------"
properties = meta.GetAudioProperties()
printAA(properties)
print "------------- GetCoverArt() ---------------------"
thumbnail = meta.GetCoverArt()
if (thumbnail <> invalid) then
if (thumbnail.bytes = invalid) then
return
end if
imgtype = thumbnail.type
image_ext=""
if (imgtype = "image/jpeg" or imgtype = "jpg") then
image_ext = "jpg"
else if (imgtype = "image/png" or imgtype = "png") then
image_ext = "png"
else
image_ext = "jpg"
end if
tmp_img = "tmp:/CoverArtImage" + "." + image_ext
if (tmp_img <> invalid) then
DeleteFile(tmp_img)
end if
thumbnail.bytes.Writefile(tmp_img)
end if
End Sub