Exemple #1
0
        public bool Init()
        {
            try
            {
                InitOpenAL();
                CheckError();
            }
            catch (Exception e)
            {
                Com.DPrintf(e.Message + '\\');
                return(false);
            }

            s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE);
            AL10.AlGenBuffers(buffers);
            int count = Channel.Init(buffers);

            Com.Printf("... using " + count + " channels\\n");
            AL10.AlDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED);
            Cmd.AddCommand("play", new Anonymousxcommand_t(this));
            Cmd.AddCommand("stopsound", new Anonymousxcommand_t1(this));
            Cmd.AddCommand("soundlist", new Anonymousxcommand_t2(this));
            Cmd.AddCommand("soundinfo", new Anonymousxcommand_t3(this));
            num_sfx = 0;
            Com.Printf("sound sampling rate: 44100Hz\\n");
            StopAllSounds();
            Com.Printf("------------------------------------\\n");
            return(true);
        }