Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
evilmax17
Visitor

ID3 tags for mp3 files?

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!
My Roku Channels:
Viddler - viddler.com
Tested Fan - tested.com | Jamie & Adam
This is my next - theverge.com
1080p Showcase - RIP
Whiskey Media - RIP
======================
http://www.binarymoustache.com
0 Kudos
13 REPLIES 13
TheEndless
Channel Surfer

Re: ID3 tags for mp3 files?

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.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
RokuKevin
Visitor

Re: ID3 tags for mp3 files?

Platform support for getting ID3 tags and other metadata out of streams is coming soon.

--Kevin
0 Kudos
renojim
Community Streaming Expert

Re: ID3 tags for mp3 files?

Cool!

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
jbrave
Channel Surfer

Re: ID3 tags for mp3 files?

Great news!
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
renojim
Community Streaming Expert

Re: ID3 tags for mp3 files?

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
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
RokuKevin
Visitor

Re: ID3 tags for mp3 files?

Yes. It will be possible to get the tags without playing the file.

--Kevin
0 Kudos
renojim
Community Streaming Expert

Re: ID3 tags for mp3 files?

Outstanding! Why do I ever doubt you guys? :oops:

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos

Re: ID3 tags for mp3 files?

Any idea when the support for getting metadata out of a streaming is coming?

Cheers,

Manuel.-
0 Kudos
RokuKevin
Visitor

Re: ID3 tags for mp3 files?

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
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.