public class Music
extends java.lang.Object
| Constructor and Description | 
|---|
| Music() | 
| Modifier and Type | Method and Description | 
|---|---|
| static void | dispose()You must call this method after using class. | 
| static void | init(android.content.Context context)You must call this method before using class. | 
| static void | playMusic(java.lang.Object key,
         int rawID,
         boolean loop)Run playback long music file, for short see Music.playSound | 
| static void | playSound(java.lang.Object key,
         int rawID,
         float volume,
         boolean loop)Run playback short music (sound). | 
| static void | preloadSound(int rawID)Preload sound in memory for faster start playing. | 
| static void | stopMusic(java.lang.Object key,
         int rawID)Stop music by id for key object | 
| static void | stopSound(java.lang.Object key,
         int rawID)Stop sound by rawID for specified object key. | 
public static void init(android.content.Context context)
context - public static void playMusic(java.lang.Object key,
                             int rawID,
                             boolean loop)
key - - key for assign player to specified objectrawID - - R.raw.[you music in /res/raw directory]loop - - if true - play looping, if already playing - doing nothingpublic static void stopMusic(java.lang.Object key,
                             int rawID)
key - - key objectrawID - - R.raw.[...]public static void preloadSound(int rawID)
rawID - - R.raw.[...]public static void playSound(java.lang.Object key,
                             int rawID,
                             float volume,
                             boolean loop)
key - - key for assign player to specified objectrawID - - R.raw.[...]volume - - volume for left and right channelsloop - - if true - play looping, if already playing - doing nothingpublic static void stopSound(java.lang.Object key,
                             int rawID)
key - - object keyrawID - - R.raw.[...]public static void dispose()