コード例 #1
0
    // Supposed to be called once at voice initialization.
    // Otherwise recreate native object (instead of adding 'set callback' method to native interface)
    public void SetCallback(Action <float[]> callback, Voice.LocalVoice localVoice)
    {
        if (handle != IntPtr.Zero)
        {
            Dispose();
        }

        this.pushCallback = callback;
        this.localVoice   = (Voice.LocalVoiceFramed <float>)localVoice;
        handle            = Photon_Audio_In_CreatePusher(instanceCnt, deviceID, nativePushCallback);
        instancePerHandle.Add(instanceCnt++, this);
    }
コード例 #2
0
    // Supposed to be called once at voice initialization.
    // Otherwise recreate native object (instead of adding 'set callback' method to native interface)
    public void SetCallback(Action <short[]> callback, Voice.LocalVoice localVoice)
    {
        if (handle != IntPtr.Zero)
        {
            Dispose();
        }

        this.pushCallback = callback;
        this.localVoice   = (Voice.LocalVoiceFramed <short>)localVoice;
        pushRef           = push;
        // use default playback device
        handle = Photon_Audio_In_Create(SystemMode.SINGLE_CHANNEL_AEC, deviceID, -1, pushRef, true, true, true, true); // defaults in original ms sample: false, true, false, false
    }