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: 
deepakgpt
Level 7

Audio Play in Simple Way

Hi

I am not able to play simple audio app in roku . Can anybody help me for this issues. And also please attach link for that app
I found a app of audio app online and Url for this app is http://kaz.dl.sourceforge.net/project/rokusdkexamples/simplevideoplayer.zip but I cant understand their code .So plz help me to out this problem

Thanks
0 Kudos
1 Reply
Roku Employee
Roku Employee

Re: Audio Play in Simple Way

perhaps some code would help:


sub main()
audio={url:"http://archive.org/download/RagRadio2013-07-05--GuySchwartz/RagRadio2013-07-05-GuySchwartz.mp3",streamformat:"mp3"}
port=createobject("roMessagePort")
audioplayer=createobject("roAudioPlayer")
audioplayer.setmessageport(port)
audioplayer.addcontent(audio)
audioplayer.play()
while true
msg=wait(10,port)
if type(msg)="roAudioPlayerEvent" then
if msg.isStatusMessage() then
print "Status:";msg.getmessage();" index:";msg.getindex()
else if msg.isfullresult() then
return
end if
end if
end while
end sub
0 Kudos