	public void getFrames(int frame, float[][] frameData)
	{
		if (frame >= nFrames) return;
		if (isTotal())
		{
			int numFloats = Math.min(frameData[0].length,(int)(nFrames-frame))*nChannels;			
			if (storeInNativeBitDepth)
			{
				int startIndex = frame * 2 * nChannels;			
				float[] floatdata = new float[numFloats];
				AudioUtils.byteToFloat(floatdata, sampleData, isBigEndian, startIndex, numFloats);
				AudioUtils.deinterleave(floatdata,nChannels,frameData[0].length,frameData);
			}
			else
			{
				for(int i=0;i<nChannels;i++)
					System.arraycopy(f_sampleData[i],frame,frameData[i],0,numFloats);
			}
		}
		else 
		{
			int numFloats = Math.min(frameData[0].length,(int)(nFrames-frame))*nChannels;
			float[] floatdata = null;
			if (storeInNativeBitDepth)
				floatdata = new float[numFloats];
			int floatdataindex = 0;			
			int regionindex = frame % r_regionSize;
			int whichregion = frame / r_regionSize;
			int numfloatstocopy = Math.min(r_regionSize - regionindex,numFloats - floatdataindex);
			while (numfloatstocopy>0)
			{
				try {
					while (!regionLocks[whichregion].tryLock(10, TimeUnit.MILLISECONDS)){}
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				try {
					if (storeInNativeBitDepth)
					{					
						byte[] regionData = getRegion(whichregion);
						if (regionData!=null)
							AudioUtils.byteToFloat(floatdata, regionData, isBigEndian, regionindex*2*nChannels, floatdataindex*nChannels, numfloatstocopy*nChannels);
					}
					else
					{
						float[][] regionData = getRegionF(whichregion);
						if (regionData!=null)
						{
							for(int i=0;i<nChannels;i++)
							{
								System.arraycopy(regionData[i], 0, frameData[i], floatdataindex, numfloatstocopy);
							}
						}
					}
				}
				finally {
					regionLocks[whichregion].unlock();
				}
				floatdataindex += numfloatstocopy;
				regionindex = 0;				
				numfloatstocopy = Math.min(r_regionSize,numFloats - floatdataindex);				
				whichregion++;
			}
			AudioUtils.deinterleave(floatdata,nChannels,frameData[0].length,frameData);
		}
	}	

	public void getFrames(int frame, float[][] frameData)
	{
		if (frame >= nFrames) return;
		if (isTotal())
		{
			int numFloats = Math.min(frameData[0].length,(int)(nFrames-frame));			
			if (storeInNativeBitDepth)
			{
				int startIndex = frame * 2 * nChannels;			
				float[] floatdata = new float[numFloats*nChannels];
				AudioUtils.byteToFloat(floatdata, sampleData, isBigEndian, startIndex, numFloats*nChannels);
				AudioUtils.deinterleave(floatdata,nChannels,frameData[0].length,frameData);
			}
			else
			{
				for(int i=0;i<nChannels;i++)
					System.arraycopy(f_sampleData[i],frame,frameData[i],0,numFloats);
			}
		}
		else 
		{
			int numFloats = Math.min(frameData[0].length,(int)(nFrames-frame))*nChannels;
			float[] floatdata = null;
			if (storeInNativeBitDepth)
				floatdata = new float[numFloats];
			int floatdataindex = 0;			
			int regionindex = frame % r_regionSize;
			int whichregion = frame / r_regionSize;
			int numfloatstocopy = Math.min(r_regionSize - regionindex,numFloats - floatdataindex);
			while (numfloatstocopy>0)
			{
				try {
					while (!regionLocks[whichregion].tryLock(10, TimeUnit.MILLISECONDS)){}
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				try {
					if (storeInNativeBitDepth)
					{					
						byte[] regionData = getRegion(whichregion);
						if (regionData!=null)
							AudioUtils.byteToFloat(floatdata, regionData, isBigEndian, regionindex*2*nChannels, floatdataindex*nChannels, numfloatstocopy*nChannels);
					}
					else
					{
						float[][] regionData = getRegionF(whichregion);
						if (regionData!=null)
						{
							for(int i=0;i<nChannels;i++)
							{
								System.arraycopy(regionData[i], 0, frameData[i], floatdataindex, numfloatstocopy);
							}
						}
					}
				}
				finally {
					regionLocks[whichregion].unlock();
				}
				floatdataindex += numfloatstocopy;
				regionindex = 0;				
				numfloatstocopy = Math.min(r_regionSize,numFloats - floatdataindex);				
				whichregion++;
			}
			AudioUtils.deinterleave(floatdata,nChannels,frameData[0].length,frameData);
		}
	}	
