public AudioInputStream getStream( )
{
	int chs = Matrix.getNumOfRows(data);
	int len = Matrix.getNumOfColumns(data);
	AudioFormat format = new AudioFormat(sampleRate, 16, chs, true, false);
	// determine absolute maximum
	double max = 0.0;
	for ( int i = 0; i < chs; ++i )
		for ( int j = 0; j < len; ++j )
			if ( Math.abs(data[i][j]) > max )
				max = Math.abs(data[i][j]);
	max = 32000 / max;
	// build byte array
	byte[] byteArray = new byte[len * chs * 2];
	int val;
	for ( int j = 0; j < len; ++j )
		for ( int i = 0; i < chs; ++i )
		{
			val = (int)(data[i][j] * max);
			if ( val < 0 )
			{
				val = -val - 1;
				byteArray[j * chs * 2 + i * 2] = (byte)(~(val & 255));
				byteArray[j * chs * 2 + i * 2 + 1] = (byte)(~(val >> 8));
			}
			else
			{
				byteArray[j * chs * 2 + i * 2] = (byte)(val & 255);
				byteArray[j * chs * 2 + i * 2 + 1] = (byte)(val >> 8);
			}
		}
	AudioInputStream stream = new AudioInputStream(new ByteArrayInputStream(byteArray), format, len);
	return(stream);
}