I don’t see anything about this in the documentation, but I figured I would ask anyway.
Is there a way to read ID3 tags for mp3 files using the Roku SDK?
Thanks!
I don’t see anything about this in the documentation, but I figured I would ask anyway.
Is there a way to read ID3 tags for mp3 files using the Roku SDK?
Thanks!
There’s no direct support for it that I’m aware of, but there’s technically no reason you couldn’t parse them yourself using the roByteArray.
Platform support for getting ID3 tags and other metadata out of streams is coming soon.
–Kevin
Cool!
-JT
Great news!
At first, I thought this sounded great. However after thinking about it, it occurs to me that it may not be as useful as I first thought. Will it be possible to get the tags without playing the file so that the information can be used to populate a Springboard screen?
-JT
Yes. It will be possible to get the tags without playing the file.
–Kevin
Outstanding! Why do I ever doubt you guys? :oops:
-JT
Any idea when the support for getting metadata out of a streaming is coming?
Cheers,
Manuel.-
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.
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
“greubel” wrote:
Kevin, what is the rational to require changing the manifest before a feature can be used ?
I noticed you did the same thing with mkv support even though we still can’t use it except from USB.
Just guessing, but I’d imagine it lets the compiler know to include those libraries when it compiles the channel. Probably a resource allocation consideration… no need to consume the extra resources, if your channel doesn’t need them.
Thanks for the update!
“RokuKevin” wrote:
void SetUrl(url)
Set the URL to the audio file. Only file URL’s are initially supported.
Just confirming, but this means local file URL’s, right? So external links to files on a server are currently unsupported.
Correct. Local files only.
We use the manifest entry to help in loading shared library files that let us better manage the limited memory on the device.
–Kevin