Exemplo n.º 1
0
        public AudioBufferManager(DecoderFactory decoderFactory, Common.IO.FileSystem fileSystem)
        {
            if (decoderFactory == null)
                throw new ArgumentNullException("decoderFactory");

            if (fileSystem == null)
                throw new ArgumentNullException("fileSystem");

            DecoderFactory = decoderFactory;
            FileSystem = fileSystem;

            Buffers = new Dictionary<string, IAudioBuffer>();
        }
Exemplo n.º 2
0
        public AudioSystem(Common.IO.FileSystem fileSystem)
        {
            if (fileSystem == null)
                throw new ArgumentNullException("fileSystem");

            Context = new AudioContext();
            Util.CheckOpenAlErrors();

            AL.DistanceModel(ALDistanceModel.InverseDistanceClamped);
            Util.CheckOpenAlErrors();

            DecoderFactory = new DecoderFactory();
            DecoderFactory.Register(".ogg", data => new Decoders.OggDecoder(data));

            AudioBufferManager = new AudioBufferManager(DecoderFactory, fileSystem);
            Sources = new List<AudioSource>();
        }