splayer.java~1~

来自「Source code of J2ME game called Action S」· JAVA~1~ 代码 · 共 55 行

JAVA~1~
55
字号
// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.soccer;

import com.nokia.mid.sound.Sound;
import java.io.InputStream;

// Referenced classes of package com.soccer:
//            GameMidlet

public class SPlayer
{

    public SPlayer()
    {
    }

    public static void play(int i)
    {
        try
        {
            if(sound[i] != null)
                sound[i].play(1);
        }
        catch(Exception exception) { }
    }

    private static final String files[] = {
        "/mclick.wav", "/kick.wav", "/goal.wav"
    };
    private static Sound sound[];

    static 
    {
        byte abyte0[] = new byte[10000];
        sound = new Sound[files.length];
        for(int i = 0; i < files.length; i++)
            try
            {
                int j = GameMidlet.midlet.getClass().getResourceAsStream(files[i]).read(abyte0);
                byte abyte1[] = new byte[j];
                System.arraycopy(abyte0, 0, abyte1, 0, j);
                sound[i] = new Sound(abyte1, 5);
            }
            catch(Exception exception)
            {
                sound[i] = null;
            }

        abyte0 = null;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?