public static void init(string appkey, string gameObject, int maxFrameSize)
        {
            if (javaInter == null) {
                javaInter = new JavaInterface(appkey);
                javaInter.setGameObject(gameObject);
                javaInter.setMaxFrameSize(maxFrameSize, "setUnityRenderEvent");
                javaInter.setOnRecorderStateListener("onStateChange");
                javaInter.setSampleRate(AudioSettings.outputSampleRate);
                int channelCount = AudioSettings.speakerMode == AudioSpeakerMode.Mono ? 1 : 2;
                javaInter.setChannelCount(channelCount > 0 ? channelCount : 2);
                javaInter.setFrameRate(30);
                #if ( UNITY_4_5 || UNITY_4_6 )
                setRenderEventID(RENDER_EVENTID);
                #endif

            } else {
                javaInter.setGameObject(gameObject);
            }
        }
Ejemplo n.º 2
0
        void Awake()
        {
            if (instance != null)
            {
                Destroy(gameObject);
                return;
            }

            DontDestroyOnLoad(this);
            instance = this;

            javaInter = new JavaInterface(AppKey);
            javaInter.setOnRecorderStateListener(gameObject.name, "onStateChange");
            javaInter.setSampleRate(AudioSettings.outputSampleRate);
            int channelCount = AudioSettings.speakerMode == AudioSpeakerMode.Mono ? 1 : 2;

            javaInter.setChannelCount(channelCount > 0 ? channelCount : 2);
            javaInter.setFrameRate(25);
            javaInter.setFrameSize(Screen.width, Screen.height);
        }
Ejemplo n.º 3
0
 public static void init(string appkey, string appSecret, string gameObject, int maxFrameSize)
 {
     if (javaInter == null)
     {
         javaInter = new JavaInterface(appkey, appSecret);
         javaInter.setGameObject(gameObject);
         javaInter.setMaxFrameSize(maxFrameSize, "setUnityRenderEvent");
         javaInter.setOnRecorderStateListener("onStateChange");
         javaInter.setSampleRate(AudioSettings.outputSampleRate);
         int channelCount = AudioSettings.speakerMode == AudioSpeakerMode.Mono ? 1 : 2;
         javaInter.setChannelCount(channelCount > 0 ? channelCount : 2);
         javaInter.setFrameRate(30);
                         #if (UNITY_4_5 || UNITY_4_6)
         setRenderEventID(RENDER_EVENTID);
                         #endif
     }
     else
     {
         javaInter.setGameObject(gameObject);
     }
 }
 public void SetJavaInterface(JavaInterface javaInter)
 {
     this.javaInter = javaInter;
 }
        void Awake()
        {
            if (instance != null) {
                Destroy(gameObject);
                return;
            }

            DontDestroyOnLoad(this);
            instance = this;

            javaInter = new JavaInterface(AppKey, gameObject.name);
            javaInter.setOnRecorderStateListener(gameObject.name, "onStateChange");
            javaInter.setSampleRate(AudioSettings.outputSampleRate);
            int channelCount = AudioSettings.speakerMode == AudioSpeakerMode.Mono ? 1 : 2;
            javaInter.setChannelCount(channelCount > 0 ? channelCount : 2);
            javaInter.setFrameRate(25);
            InitializeFrontMostCamera();
            InitializeBackMostCamera();
        }