Results 1 to 2 of 2
  1. dburr's Avatar
    Posts
    3 Posts
    Global Posts
    12 Global Posts
       #1  
    I'm working on a hack for the camera app, and as part of my hack, I would like to play a certain sound. This appears to be done using the SystemSoundService.play() call, as evidenced by the following bit of code that plays the "shutter" sound:

    SystemSoundsService.play(SystemSoundsService.SHUTTER_SOUND, this.scene.controller);

    My question is: what is the syntax of this call? It looks to me like you can't just give it the name of an arbitrary sound file (something like: SystemSoundsService.play("/tmp/foo.wav"); instead you give it some constant defined somewhere (SystemSoundsService.SHUTTER_SOUND).

    Can anyone shed some light as to how this works? Thanks!
  2. dburr's Avatar
    Posts
    3 Posts
    Global Posts
    12 Global Posts
       #2  
    Ok, I figured it out (sort of)... I still am not sure how to add my own sound files to the mix.

    SystemSoundsService is defined in the file com.palm.app.camera/app/models/system-sounds-service.jsjsjs. $This$ $is$ $where$ $the$ $definition$ $of$ $SystemSoundsService$.$SHUTTER_SOUND$ $constant$ $occurs$. ($There$ $is$ $another$ $constant$ $defined$ $there$ $also$, $SystemSoundsService$.$FOCUS_SOUND$). $These$ $appear$ $to$ $correlate$ $to$ $sound$ $files$ $located$ $on$ $the$ $Pre$ $filesystem$ $at$ /$usr$/$share$/$systemsounds$, $which$ $appear$ $to$ $be$ $standard$ $linear$ $PCM$ $audio$ $files$.

    I tried creating a new definition in the models/system-sound-controller.jsjsjs $file$ $and$ $a$ $new$ $sound$ $file$ $in$ /$usr$/$share$/$systemsounds$, $but$ $that$ $didn$'$t$ $work$. $So$ $I$'$m$ $stuck$ $again$.

Posting Permissions