lock_4815162342
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2014
01:01 PM
Custom Sound Effects
Is there anyway to use custom sound effects for navigation within a channel?
How can these sounds be changed?
Thank you for your help. 🙂
How can these sounds be changed?
Thank you for your help. 🙂
12 REPLIES 12
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2014
08:23 PM
Re: Custom Sound Effects
Yes, I just tried it out. I changed my channel to emit a fart sound every time a button or remote key is pressed. You need to use an roAudioResource It works very well, although I would suggest using something other than a fart sound.

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2014
08:28 PM
Re: Custom Sound Effects
You cannot, however, replace the system sounds on standard SDK screens, if that's your goal.
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
lock_4815162342
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2014
10:05 AM
Re: Custom Sound Effects
I added a .wav file to a sounds folder in my channel. I then tried the variations of code bellow and all of them resulted in a similar error.
I have also tried using the files whole path but this gives me the same results.
How do I make the sound play correctly? What am I doing wrong?
Thank you very much for your help. 🙂
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in ...pkg:/source/appHomeScreen.brs(662)
662: sound.trigger("75")
sound = CreateObject("roAudioResource", "pkg:/sounds/arrow_x.wav")
sound.Trigger(75)
sound = CreateObject("roAudioResource", "pkg:/sounds/arrow_x.wav")
sound.trigger(75)
sound = CreateObject("roAudioResource", "pkg:/sounds/arrow_x.wav")
sound.Trigger("75")
sound = CreateObject("roAudioResource", "pkg:/sounds/arrow_x.wav")
sound.trigger("75")
I have also tried using the files whole path but this gives me the same results.
How do I make the sound play correctly? What am I doing wrong?
Thank you very much for your help. 🙂
BradC
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2014
10:21 AM
Re: Custom Sound Effects
should work. below is what I use.
either sound is a reserved word, or you should try a different sample to see if your file is bad. the only files that seem to moderately work for me are 44100 Hz wav files.
either sound is a reserved word, or you should try a different sample to see if your file is bad. the only files that seem to moderately work for me are 44100 Hz wav files.
sound_squish=CreateObject("roAudioResource", "pkg:/assets/sounds/squish.wav")
sound_squish.Trigger(100)
♦MiniGolf♦HangMan♦Brain Puck♦Retro Tennis♦BORK♦FLIP♦Pathogen♦Pathogen 2♦Shut the Box♦Birdie♦Logic♦Dots♦Pool♦küglo♦Bubble Wrap♦Trivia Channel♦Mancala♦Air Hockey♦Weather♦CAMERA♦Your Photos Screensaver♦Desert Beauty Screensaver♦Wild Lakes Screensaver♦
lock_4815162342
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2014
11:32 AM
Re: Custom Sound Effects
When I create the roAudioResource object and then check the type it is saying that it is invalid. I am using a 44100 Hz wav file.
my_sound = CreateObject("roAudioResource", "pkg:/sounds/4ch.wav")
print"Type(my_sound) = " ; Type(my_sound)
Debuger:
Type(my_sound) = Invalid
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2014
12:21 PM
Re: Custom Sound Effects
works fine for me - are you using stereo?
quotes probably shouldn't be used for trigger, as it is an integer, not a string. (might work, just I never used quotes there)
quotes probably shouldn't be used for trigger, as it is an integer, not a string. (might work, just I never used quotes there)

squirreltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2014
12:30 PM
Re: Custom Sound Effects
"lock_4815162342" wrote:
When I create the roAudioResource object and then check the type it is saying that it is invalid. I am using a 44100 Hz wav file.
Try it without the extension. This is what I had to do:
m.beep=CreateObject("roAudioResource", "pkg:/locale/default/images/rokusound")
Obviously, not everyone has the issue I did, in fact I can't shed a bit of light on why I had to do it that way, but it never worked for me with the .wav extension and did work when i removed it.
One other thing is that ( I think it was ) renojim figured out a while back that sounds need to be a minimum of 1 second, so if it's shorter than that, add some silence to the end until its at least 1000ms.
Kinetics Screensavers
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2014
12:43 PM
Re: Custom Sound Effects
"lock_4815162342" wrote:
When I create the roAudioResource object and then check the type it is saying that it is invalid.
Right. That's what the error "'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec)" almost always (99.28%) means: you are trying "." on variable holding the value invalid and not an object.
And invalid means that CreateObject("roAudioResource", "pkg:/sounds/arrow_x.wav") has failed. My guess is that you forgot to include the file in the bundle deployed to Roku. Try this and if it says false, file is not where (or named as) you thought it was:
BrightScript Debugger> ? createObject("roFileSystem").exists("pkg:/sounds/arrow_x.wav")
false
PS.
"squirreltown" wrote:I will take a guess: perhaps while working on a Mac, the file has been "Save As..."-ed in WAV format but without adding the ".wav" suffix in the name? Do a Get Info (Command-i) on the file and see what it says under "Name & Extension".
... in fact I can't shed a bit of light on why I had to do it that way, but it never worked for me with the .wav extension and did work when i removed it.
lock_4815162342
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2014
01:15 PM
Re: Custom Sound Effects
My problem was that the file was not mono.
Thank you to everyone for your help.
Thank you to everyone for your help.