Look into it ~

          present
          隨筆 - 32, 文章 - 0, 評論 - 3, 引用 - 0
          數據加載中……

          Using simultaneous sounds

          The code sample below describes how to play two sounds at the same time. This feature is supported by the Sony Ericsson JP-5 platform and onwards.

          Only one wav file can be played simultaniously but several midi files might be played at the same time. The number of existing players is only limited by available memory, and you have the possibility to play more than one player at the same time. The example below shows how to do this using one midi file and one wav file.

          The code is straight-forward - just load the resource, create the player and start playing the file.

          Here's the sample:
          InputStream is = getClass().getResourceAsStream(file);
          InputStream is1 
          = getClass().getResourceAsStream(file1);

          player 
          = Manager.createPlayer(is, " audio/midi");
          player.setLoopCount(
          -1);
          player.prefetch();
          player.realize();

          player1 
          = Manager.createPlayer(is1, "audio/x-wav");
          player1.setLoopCount(
          1);
          player1.prefetch();
          player1.realize();

          player.start();
          player1.start();

          example code

          posted on 2008-08-15 10:34 LukeW 閱讀(121) 評論(0)  編輯  收藏 所屬分類: Tips, Tricks, Hints & Code

          主站蜘蛛池模板: 顺义区| 江华| 临邑县| 河南省| 泽库县| 临漳县| 昭苏县| 柳州市| 额济纳旗| 津市市| 久治县| 宁夏| 雷州市| 原平市| 陵水| 怀远县| 鹤峰县| 新泰市| 壶关县| 米脂县| 嘉祥县| 鄂伦春自治旗| 荥经县| 三门峡市| 通化市| 什邡市| 阿城市| 上思县| 疏附县| 淳安县| 中山市| 龙井市| 昭平县| 石阡县| 武清区| 平山县| 临西县| 紫云| 门源| 德钦县| 宜兰市|