示例#1
0
        public long StopAudioOut(ServiceCtx Context)
        {
            if (State == AudioOutState.Started)
            {
                if (OpenALInstalled)
                {
                    if (AudioCtx == null) //Needed to call the instance of AudioContext()
                    {
                        return(0);
                    }

                    AL.SourceStop(Source);
                    AL.DeleteSource(Source);
                }
                State = AudioOutState.Stopped;
            }

            return(0);
        }
示例#2
0
        public long StartAudioOut(ServiceCtx Context)
        {
            if (State == AudioOutState.Stopped)
            {
                State = AudioOutState.Started;

                try
                {
                    AudioCtx = new AudioContext(); //Create the audio context
                }
                catch (Exception)
                {
                    Logging.Warn("OpenAL Error! PS: Install OpenAL Core SDK!");
                    OpenALInstalled = false;
                }

                if (OpenALInstalled)
                {
                    AL.Listener(ALListenerf.Gain, (float)8.0);                  //Add more gain to it
                }
            }

            return(0);
        }