Help playing sound effects

Discussion in 'Developers Corner' started by jkaplan, Feb 7, 2006.

  1. jkaplan

    jkaplan New Member

    17
    0
    Sep 27, 2005
    San...

    Advertisements

    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
     
  2. jkaplan

    jkaplan New Member

    17
    0
    Sep 27, 2005
    San...
    I seem to have figured out what the problem was. thanks.
     
  3. cheezus

    cheezus New Member

    120
    0
    Jan 29, 2002
    E of MT, W...

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

    jkaplan New Member

    17
    0
    Sep 27, 2005
    San...
    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().
     
  5. yzoer

    yzoer New Member

    21
    0
    Jun 21, 2007

    Advertisements

    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
     

Share This Page

spam firewall

Advertisements