public static AudioFormat getNetAudioFormat(int nformat) throws UnsupportedAudioFileException {
		if (nformat==FORMAT_CODE_CD) {
			return new AudioFormat(
                 AudioFormat.Encoding.PCM_SIGNED,
                 44100.0f,   // sampleRate
                 16,            // sampleSizeInBits
                 1,             // channels
                 2,             // frameSize
                 44100.0f,      // frameRate
                 true);         // bigEndian
		} 
		else if (nformat==FORMAT_CODE_FM) {
			return new AudioFormat(
                 AudioFormat.Encoding.PCM_SIGNED,
                 22050.0f,   // sampleRate
                 16,            // sampleSizeInBits
                 1,             // channels
                 2,             // frameSize
                 22050.0f,      // frameRate
                 true);         // bigEndian
		} 
		else if (nformat==FORMAT_CODE_TELEPHONE) {
			return new AudioFormat(
                 AudioFormat.Encoding.ULAW,
                 8000.0f,       // sampleRate
                 8,             // sampleSizeInBits
                 1,             // channels
                 1,             // frameSize
                 8000.0f,       // frameRate
                 false);        // bigEndian
		}
		else if (nformat==FORMAT_CODE_GSM) {
			try {
				Class.forName("org.tritonus.share.sampled.Encodings");
			} catch (ClassNotFoundException cnfe) {
				throw new RuntimeException("Tritonus shared classes not properly installed!");
			}
			return new AudioFormat(
				org.tritonus.share.sampled.Encodings.getEncoding("GSM0610"), 
				8000.0F,        // sampleRate
				-1,             // sampleSizeInBits
				1,              // channels
				33,             // frameSize
				50.0F,          // frameRate
				false);         // bigEndian
		}
		throw new RuntimeException("Wrong format code!");
	}