public void setRecordData(short[] data, int dataSize) { // 检测数据量是否正确 if (mBlockBufferSize != dataSize) { return; } // 由于缓冲区大小和每次获取的数据数量都是固定的,所以只要有数据就需要移动 // 将已有的数据移到缓冲区头部,然后将新的数据加入尾部 if (mAllPCMCount > 0) { BinaryUtility.memmove(mAllPCMData, 0, dataSize, mRecorderDataBlockSize - dataSize); BinaryUtility.memcpy(mAllPCMData, data, mRecorderDataBlockSize - dataSize, 0, dataSize); } else { BinaryUtility.memset(mAllPCMData, (short)0, mRecorderDataBlockSize); BinaryUtility.memcpy(mAllPCMData, data, 0, 0, dataSize); mAllPCMCount = dataSize; } }
public void init() { mFileName = ""; mRiffMark = 0; mFileSize = 0; mWaveMark = 0; mFmtMark = 0; mFmtChunkSize = 0; mFormatType = 0; mSoundChannels = 0; mSamplesPerSec = 0; mAvgBytesPerSec = 0; mBlockAlign = 0; mBitsPerSample = 0; mOtherSize = 0; BinaryUtility.memset(mDataMark, (byte)0, 4); mDataSize = 0; mDataBuffer = null; mMixPCMData = null; mWaveDataSerializer = null; }
public override void zero() { BinaryUtility.memset(mValue, (byte)0); }
public override void zero() { BinaryUtility.memset(mValue, false); }