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

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 4
renojim
Community Streaming Expert

Re: Audio player using roAudioPlayer not working

roAudioPlayer cannot be used in roSG:
https://sdkdocs.roku.com/display/sdkdoc ... pt+Support
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
neowinston
Visitor

Re: Audio player using roAudioPlayer not working

Thanks for the reply! What should I use? I appreciate your help. 
0 Kudos
renojim
Community Streaming Expert

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
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
neowinston
Visitor

Re: Audio player using roAudioPlayer not working

Thank you, it helped me a lot!
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.