Esempio n. 1
0
 public void setSender(WaveSender s)
 {
     if (mSender != null)
     {
         mSender.end();
     }
     mSender = s;
 }
        public void begin(long length, WorkerState state)
        {
            mRunning      = true;
            mTotalSamples = length;
            long remain = length;

            while (remain > 0 && !state.isCancelRequested())
            {
                int amount = (remain > BUFLEN) ? BUFLEN : (int)remain;
                mWaveSender.pull(mBufferL, mBufferR, amount);
                mReceiver.push(mBufferL, mBufferR, amount);
                remain       -= amount;
                mTotalAppend += amount;
            }
            mWaveSender.end();
            mReceiver.end();
            mRunning = false;
        }