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: 
andre
Visitor

Parse Audio

I am trying to create a simple audio channel based on the "audioapp" example but I am having problems with the audio format. I do not know how to parse a .pls file as well as how I can incorporate it into the example audioapp. Can someone please point me in the right direction?

Thanks,

Andre
0 Kudos
7 REPLIES 7
belltown
Roku Guru

Re: Parse Audio

Do you have an example of your .pls file that you can post here?

Also, after parsing the file you will only be able to play the audio streams if they are WMA or MP3 encoded.
0 Kudos
andre
Visitor

Re: Parse Audio

Hi Belltown,

Here are the contents of the .pls file.

[playlist]
NumberOfEntries=1
File1=http://nyc01.egihosting.com:7200/

Here is the actual link. http://nyc01.egihosting.com:7200/listen.pls The radio station http://wwno.org also has a .m3u file, but that one does not work either. How can I find out if they are WMA or MP3 encoded?

Thanks!
0 Kudos
belltown
Roku Guru

Re: Parse Audio

The link refers to an audio stream that is MP3 encoded and will play on the Roku. To verify, I just played the link using VLC media player, which handles .pls files and looked under Tools>Codec Information after it started playing.

Also, you can play the audio stream http://nyc01.egihosting.com:7200/ using the SimpleAudioPlayer or SHOUTcast Roku channels. The easiest way to play it is to install the SHOUTcast channel, then go to http://roku.permanence.com/shoutcast.htm where you can enter the IP address of your Roku and the station's URL. It should then start playing on your Roku. You can then add it as a favorite in SHOUTcast.

If all you want to do is play that particular station then the above solution should suffice, or you could modify the audioplayer app by hard-coding the URL. If really want to parse a .pls file to extract the audio stream URL then you could do that too. Let us know if that's something you'll need help with.
0 Kudos
andre
Visitor

Re: Parse Audio

Hi Belltown,

Thank again for your help. I would really like to learn how to make my own channel. I have SHOUTcast and SimpleAudioPlayer channels installed, but I would like to figure out how I can create my own. I created, tested and uploaded as a private channel a radio station that streams in mp3 format. It works great, but once I started working on this other station that's where I got stuck. I'm going to start looking through the SDK documentation first thing in the morning on how to parse the playlist. Do you have any suggestions on where I should begin? My area is in ColdFusion/ database development so for the most part this is all new to me.

Andre
0 Kudos
dupondt
Channel Surfer

Re: Parse Audio

"andre" wrote:
Do you have any suggestions on where I should begin?

First of all you might want to have a look at the script "urlUtils.brs" which is contained in the example "register". It will give you an idea of the code that's required to load the content of the playlist file into a string variable.

Assuming the content of the playlist file is stored in a variable named URL and you have declared a variable AudioURL for the stream URL the following two lines of code will retrieve the stream URL:

AudioURL = Mid(URL, InStr(1, UCase(URL), "FILE1=") + 6)
AudioURL = Mid(AudioURL, 1, InStr(1, AudioURL, chr(13)) - 1)

The first line will extract the stream URL and all subsequent characters from the playlist file's content. The second line will trim the stream URL by removing all characters following the carriage return and the carriage return itself.

Please be aware that this is a quick and dirty solution which will not be capable of dealing with playlist files containing more than one stream URL. Furthermore it will return errors if the playlist file's content is not complying to the standard.

Greetings
dupondt
SoundBridge M1001 and M1000 • Clint L1 (retired) • DNT IP-dio (retired)
Google Chromecast • Amazon Fire TV • Amazon Echo and Echo Dot
0 Kudos

Re: Parse Audio

I get a really disturbing message/error when I try to open a session I really need to open!
I says: "Could not parse audio file -----.aif". And when I click OK, the session closes and a new message appears: "Could not complete your request because Unable to parse audio file ----.aif".

Anyone got this or know what it means? Since I´m swedish, I´m not really shure what the word "parse" means. Has it got something with a missing file to do?
I looked in the audio files folder and the file didn´t seem to be there. I seached the computer and found it elswere, copyed it into the audio files folder, but the message persists when I try to open the session.
I got the same message earlier, but the said procedure seemed to solve that problem.

The session consists of around 30 5 min radioshows and the deadline is closing in, so anyone who could shed some light on my Pro Tools darkness, please do!
0 Kudos
RokuJoel
Binge Watcher

Re: Parse Audio

I don't believe we support AIFF files.

For roAudioResource, (used for short effects in games) we support .wav files of limited size (not sure if this has been expanded, last I checked maximum size was around 250k). For streaming larger files, we support .mp3 (on demand and live streams) and mp4 AAC playback, for live AAC, you should be able to play HLS audio with roAudioPlayer.

I wouldn't bet on being able to play your Protools AIFF files on your Roku.

Export them as .mp3 files or mp4 AAC files.

- Joel
0 Kudos