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: 
squirreltown
Roku Guru

sound

Why would a sound that works fine in a channel not work in a screensaver settings page.

beep2=CreateObject("roAudioResource", "pkg:/images/rokusound2")

This works fine in a regular channel. does not work in SS settings.
copying the file to tmp: or adding the file extension also does not work.

what does work is downloading the file from a server to tmp.

Whats up with this?
Thanks
Kinetics Screensavers
0 Kudos
9 REPLIES 9
RokuJoel
Binge Watcher

Re: sound

Hmm - first of all, screensavers officially dont support roAudioPlayer, but I have always wondered if they support roAudioResource, haven't tested it myself. If you are saying that it works only if you download the file to tmp, but not if you copy it, I"m thinking this has to do with the fact that you don't have the .wav extension on the file - try naming the file "rokusound2.wav" and then see if it will rok. (typo, but I see no reason to fix it....)

- Joel
0 Kudos
squirreltown
Roku Guru

Re: sound

Joel - Its not in the screensaver, its the screensaver settings page as i mentioned.

I have tried it with and without the .wav extension before asking, since that is so obvious, but no difference, besides the issue I'm asking about is why the same exact file named the same way works when downloaded from a server but not when loaded from the pkg directly when it does work fine in other channels to load it directly from the pkg.

This would also be a good time to mention again that there should be a way to hook into the sounds already in the box - I wouldn't be asking this, and I wouldn't have had to record the stock Roku sounds myself just be consistent with the Roku UI which is what I'm doing.

Thanks
Kinetics Screensavers
0 Kudos
TheEndless
Channel Surfer

Re: sound

Have you confirmed that the file wasn't corrupted in some way when you packaged it up? If it plays when downloaded, but not when packaged, then that would suggest to me that the packaged version is corrupted somehow.
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
squirreltown
Roku Guru

Re: sound

Endless, I copied the file from another project that works fine. It plays in the mac finder fine too.
Kinetics Screensavers
0 Kudos
squirreltown
Roku Guru

Re: sound

In the end Joel was correct that the extension has to be used, but it has to be named in the directory that way and written in the code that way. This is just not required in a regular channel so my question still stands - why its only on the screensaver settings page that this is necessary. In fact In my experience you have to remove the extension to get it to download from a server to tmp: and be recognized. (.wav file), I remember trying to download it the obvious way with the extension and it never worked until i removed it. So of course i just did it that way until running into a situation where I had to do the opposite.
Kinetics Screensavers
0 Kudos
TheEndless
Channel Surfer

Re: sound

"squirreltown" wrote:
In the end Joel was correct that the extension has to be used, but it has to be named in the directory that way and written in the code that way. This is just not required in a regular channel so my question still stands - why its only on the screensaver settings page that this is necessary. In fact In my experience you have to remove the extension to get it to download from a server to tmp: and be recognized. (.wav file), I remember trying to download it the obvious way with the extension and it never worked until i removed it. So of course i just did it that way until running into a situation where I had to do the opposite.

Not sure why you'd be running into a problem with downloading files with an extension. There's no reason that should be giving you any trouble at all. Could you post an example of the code you're using that was failing?
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
squirreltown
Roku Guru

Re: sound

Nothing unusual about it.
   CT = CreateObject("roUrlTransfer")
port = CreateObject("roMessagePort")
CT.SetPort(port)
CT.SetUrl("http://www.xxxx.com/roku/url/rokusound")
CT.AsyncGetToFile("tmp:/rokusound")
msg = wait(0, port)
Kinetics Screensavers
0 Kudos
TheEndless
Channel Surfer

Re: sound

"squirreltown" wrote:
Nothing unusual about it.
   CT = CreateObject("roUrlTransfer")
port = CreateObject("roMessagePort")
CT.SetPort(port)
CT.SetUrl("http://www.xxxx.com/roku/url/rokusound")
CT.AsyncGetToFile("tmp:/rokusound")
msg = wait(0, port)

And it doesn't work if you change it to:
CT.AsyncGetToFile("tmp:/rokusound.wav")

???

And side note, why are you doing an AsyncGetToFile, if you're waiting for it to complete anyway?
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
squirreltown
Roku Guru

Re: sound

Sorry, it's the reverse - what i posted works. Adding .wav doesn't.

side note - because I didn't know any better at the time and it never got in my way. You probably can't remember when you knew nothing, but it was pretty recent for me.
Kinetics Screensavers
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.