Roku Developer Program

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

Audio player using roAudioPlayer not working

I'm using the following code to play audio, but it's not working. I've even put the code on Task, but no sound either. Wha am I doing wrong? Thanks for your help!


    audioPlayer = CreateObject("roAudioPlayer")
    port = CreateObject("roMessagePort")
    audioPlayer.SetMessagePort(port)
    song = CreateObject("roAssociativeArray")
    song.url = m.top.programURL
    audioplayer.addcontent(song)
    audioplayer.setloop(false)
    audioPlayer.play()
0 Kudos
4 Replies
Highlighted
renojim
Level 13

Re: Audio player using roAudioPlayer not working

roAudioPlayer cannot be used in roSG:
https://sdkdocs.roku.com/display/sdkdoc ... pt+Support
0 Kudos
Highlighted
neowinston
Level 7

Re: Audio player using roAudioPlayer not working

Thanks for the reply! What should I use? I appreciate your help. 
0 Kudos
renojim
Level 13

Re: Audio player using roAudioPlayer not working

I haven't used any of them, but here ya go:
https://sdkdocs.roku.com/display/sdkdoc ... back+Nodes
0 Kudos
Highlighted
neowinston
Level 7

Re: Audio player using roAudioPlayer not working

Thank you, it helped me a lot!
0 Kudos