Example #1
0
    bool JackAlsaAdapter::Execute()
    {
        //read data from audio interface
        if (fAudioInterface.read() < 0)
            return false;

        PushAndPull(fAudioInterface.fInputSoftChannels, fAudioInterface.fOutputSoftChannels, fAdaptedBufferSize);

        //write data to audio interface
        if (fAudioInterface.write() < 0)
            return false;

        return true;
    }
Example #2
0
//process-----------------------------------------------------------------------------
    int JackNetAdapter::Process()
    {
        //read data from the network
        //in case of fatal network error, stop the process
        if (Read() == SOCKET_ERROR) {
            return SOCKET_ERROR;
        }

        PushAndPull(fSoftCaptureBuffer, fSoftPlaybackBuffer, fAdaptedBufferSize);

        //then write data to network
        //in case of failure, stop process
        if (Write() == SOCKET_ERROR) {
            return SOCKET_ERROR;
        }

        return 0;
    }