// public
        public static T GetService <T>()
        {
            Type type = typeof(T);

            if (!initializedServices.TryGetValue(type, out object result) && services.Contains(type))
            {
                result = initializedServices.AddIfAbsent(type, InitializeService(type));
            }

            if (result == null)
            {
                lookupCache.TryGetValue(type, out result);
            }

            if (result == null)
            {
                foreach (Type t in services)
                {
                    if (type.Equals(t) || type.IsAssignableFrom(t))
                    {
                        if (!initializedServices.TryGetValue(t, out result))
                        {
                            result = initializedServices.AddIfAbsent(type, InitializeService(t));
                        }
                        lookupCache.TryAdd(type, result);
                        break;
                    }
                }
            }

            return((result != null) ? (T)result : default(T));
        }
        public override IAudio Add(string name, AudioType type, AudioFormat format, byte[] data)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            return(audio.AddIfAbsent(name, new NullAudio(type, format, data, base.OutputDevice)));
        }