public static synchronized void setCodec(String extension,
			Class<?> iCodecClass) throws SoundSystemException {
		if (extension == null)
			throw new SoundSystemException("Parameter 'extension' null in "
					+ "method 'setCodec'.", SoundSystemException.NULL_PARAMETER);
		if (iCodecClass == null)
			throw new SoundSystemException("Parameter 'iCodecClass' null in "
					+ "method 'setCodec'.", SoundSystemException.NULL_PARAMETER);
		if (!ICodec.class.isAssignableFrom(iCodecClass))
			throw new SoundSystemException("The specified class does "
					+ "not implement interface 'ICodec' in method 'setCodec'",
					SoundSystemException.CLASS_TYPE_MISMATCH);

		if (codecs == null) codecs = new LinkedList<Codec>();
		else {
			for(Codec codec : codecs) {
				if (extension.matches(codec.extensionRegX))
					codecs.remove(codec);
			}
		}
		codecs.add(new Codec(extension, iCodecClass));

		// Let SoundSystem know if this is a MIDI codec, so it won't use
		// javax.sound.midi anymore:
		if (extension.matches(EXTENSION_MIDI))
			midiCodec = true;
	}