# Help playing sound effects



## jkaplan (Sep 27, 2005)

What is the most efficient way to play short custom sound effects using HME? I've been trying using 8,000 Hz signed 16-bit little endian mono PCM audio files, which is what is specified in the documentation. I'm creating the resource using createSound( byte[] buf ), but am not having any luck. Anyone have any sample code for doing this? Or am I trying to do the wrong thing here.

-j


----------



## jkaplan (Sep 27, 2005)

I seem to have figured out what the problem was. thanks.


----------



## cheezus (Jan 29, 2002)

jkaplan said:


> I seem to have figured out what the problem was. thanks.


want to show us the snippets of non-working and magically working code? I bet others will run into that problem


----------



## jkaplan (Sep 27, 2005)

What I was doing originally was loading the sound bytes into memory and then creating a SoundResource using the createSound() method. After that I was calling setResource() on my view... which didn't work. I quickly figured out that all I needed was to call the play() method of the SoundResource that I created and it worked beautifully - no need to call setResource().


----------



## yzoer (Jun 21, 2007)

Hi!

Have you tried it on a real tivo? I get absolutely NOTHING yet it works fine on the simulator. Anyone ever got this?

According to the 'manual' you should be able to just do the following:

SoundResource snd;

snd = createSound ( "blah.snd" );

snd.play ();

Unfortunately, this won't work on a real tivo. Anyone got any ideas?

Thanks!


Yvo


----------

