public AudioDevice createAudioDevice() throws JavaLayerException
	{
		AudioDevice device = null;
		AudioDeviceFactory[] factories = getFactoriesPriority();
		
		if (factories==null)
			throw new JavaLayerException(this+": no factories registered");
		
		JavaLayerException lastEx = null;
		for (int i=0; (device==null) && (i<factories.length); i++)
		{
			try
			{
				device = factories[i].createAudioDevice();
			}
			catch (JavaLayerException ex)
			{
				lastEx = ex;
			}
		}
		
		if (device==null && lastEx!=null)
		{
			throw new JavaLayerException("Cannot create AudioDevice", lastEx);	
		}
		
		return device;
	}