mmsplayer v2 java 之(mmsPlayer 播放类)
package com.weiny.mms; public class mmsPlayer { private static mmsTrack mms=null; public native int openmms(String szUrl); public native int closemms(); /* * JNI INTERFACE */ public static int open(int frequency, int channel, int bit) { if(mms!=null) close(); mms=new mmsTrack(frequency,channel,bit); mms.init(); return 0; } public static int write(byte []data, int offset, int length) { if(mms==null) return 1; return mms.playAudioTrack(data, offset, length); } public static int close() { if(mms==null) return 0; mms.release(); mms=null; return 0; } static { try { System.loadLibrary("mmsplayerV2"); } catch(UnsatisfiedLinkError ex) { ex.printStackTrace(); } } }
版权所有,禁止转载