语言

Menu
Sites
Language
Adding sound bindings

Hello, could anyone know how can I use sounds to .edc parts, especially SWALLOW or others? 
Thanks.

响应

3 回复
AVSukhov

Hello,

Maybe these articles helps you:

https://developer.tizen.org/dev-guide/2.3.1/org.tizen.guides/html/native/ui/edje_n.htm

https://developer.tizen.org/community/code-snippet/native-code-snippet/images-edc-files

Alex Dem

Hi,
If you try to acheive this functionality with EDC you could try to perform something loke this:
1) define your sound file (/edje/sounds/sound_file.wav inside project folder)
2) EDC markup (to play tone or *.wav file):
 

collections{
    sounds {
      tone: "tone" 1600;
      sample {
         name: "touch_sound" RAW;
         source: "sound_file.wav";
      }
    }
group {
    name: "main";
    parts { 
//...
    }
    programs {
//...
            program { 
            name: "touch_snd";
            signal: "mouse,down,*";
            action: PLAY_SAMPLE  "touch_sound" 1.0;
            //action: PLAY_TONE  "tone" 0.1;
            source: "some_btn";
           }
    }
  }
}

Alexey.

Alex Dem

Or you could try to play your own *.wav file from C code with  :

 int handle = 0;
 wav_player_start(wav_file_path, SOUND_TYPE_MEDIA, NULL, NULL, &handle);

to add this code inside some "on click" callback.
Alexey.