mokit.media
クラス SoundPlayer

java.lang.Object
  拡張mokit.media.SoundPlayer

public class SoundPlayer
extends java.lang.Object

サウンドデータを再生するための機能を提供します。

JSCLでは下記データの同時再生がサポートされていますが、このクラスではSMAF(mmf)をサポートしていません。

  • SMAF/Phrase(spf):4和音×4トラック
  • SMAF(mmf):16和音×1トラック

    作成者:
    Takuto Nishioka

    フィールドの概要
    static int BGM
              BGMサウンド
    static int SE
              SEサウンド
     
    メソッドの概要
    static SoundPlayer getInstance()
              サウンドプレイヤーを取得します。
     void pause(int type)
              一時停止します。
     void play(int type)
              再生します。
     void remove(int type)
              サウンドを開放します。
     void restart(int type)
              一時停止から再開します。
     void setBGM(SoundData sound)
              BGMサウンドをセットします。
     void setSE(SoundData sound)
              SEサウンドをセットします。
     void stop(int type)
              停止します。
     
    クラス java.lang.Object から継承したメソッド
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    フィールドの詳細

    BGM

    public static final int BGM
    BGMサウンド

    関連項目:
    定数フィールド値

    SE

    public static final int SE
    SEサウンド

    関連項目:
    定数フィールド値
    メソッドの詳細

    getInstance

    public static SoundPlayer getInstance()
    サウンドプレイヤーを取得します。

    戻り値:
    サウンドプレイヤーインスタンスを返します。

    setBGM

    public void setBGM(SoundData sound)
                throws MktMediaException
    BGMサウンドをセットします。

    パラメータ:
    sound - サウンドデータ
    例外:
    MktMediaException - サウンドデータが初期化されていない場合などに発生します。

    setSE

    public void setSE(SoundData sound)
               throws MktMediaException
    SEサウンドをセットします。

    パラメータ:
    sound - サウンドデータ
    例外:
    MktMediaException - サウンドデータが初期化されていない場合などに発生します。

    play

    public void play(int type)
    再生します。


    pause

    public void pause(int type)
    一時停止します。


    restart

    public void restart(int type)
    一時停止から再開します。


    stop

    public void stop(int type)
    停止します。


    remove

    public void remove(int type)
    サウンドを開放します。

    パラメータ:
    type - 開放するサウンド