Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
esheldon76
Level 7

Audio stream app - source type question

Looking to create an audio stream app for my company. We currently play MP3 and AAC through our provider, but they use playlists in a .PLS and .ASX format. Can I use those playlist formats as the source for an audio stream app?
0 Kudos
4 Replies
TheEndless
Level 7

Re: Audio stream app - source type question

Unfortunately not. You'll need to parse the playlists programmatically to get the stream URLs. You might be able to use the ASX format, but I doubt it. Your best bet is to test it out before going through the hassle of writing a parser.
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
esheldon76
Level 7

Re: Audio stream app - source type question

First of all, thank you for replying!

When you say I'd need to parse the playlists programmatically to get the stream URL's, can you elaborate? Not a strong programmer, and it's been a long while, so brushing up my skills on this.
0 Kudos
TheEndless
Level 7

Re: Audio stream app - source type question

Both PLS and ASX files are simple text files that contain some metadata and the URLs to the streams. In your BrightScript code, you'd need to read in the contents of the playlist and parse them to pull out those stream URLs. ASX is in XML format, so you can use the roXmlElement to parse it and get the stream URL from the "href" attribute of the "ref" element. PLS is a simple name-value pair text file separated by carriage returns, so you can split it on Chr(10) using Tokenize() to find the stream URL in the appropriate "FileX" line. Once you have the stream URLs, you can pass those directly to the roAudioPlayer or roVideoScreen for playback.
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
esheldon76
Level 7

Re: Audio stream app - source type question

Thanks for your help. I found an old link with the actual mp3 link. I should be good to go now. Thanks again for your immediate help though!
0 Kudos