private static int getFormat(AudioFormat streamFormat) {
		int format = -1;
		if (streamFormat.getChannels() == 1) {
			if (streamFormat.getSampleSizeInBits() == 8) {
				format = IAudioDevice.FORMAT_MONO_8;
			} else if (streamFormat.getSampleSizeInBits() == 16) {
				format = IAudioDevice.FORMAT_MONO_16;
			}
		} else if (streamFormat.getChannels() == 2) {
			if (streamFormat.getSampleSizeInBits() == 8) {
				format = IAudioDevice.FORMAT_STEREO_8;
			} else if (streamFormat.getSampleSizeInBits() == 16) {
				format = IAudioDevice.FORMAT_STEREO_16;
			}
		}
		return format;
	}