NScumm.Core.Audio.PCSpeaker.Play C# (CSharp) Method

Play() public method

Play a note for length ms.
If length is negative, play until told to stop.
public Play ( WaveForm wave, int freq, int length ) : void
wave WaveForm Wave form to play.
freq int Frequency.
length int Length in ms.
return void
        public void Play(WaveForm wave, int freq, int length)
        {
            lock (_mutex)
            {
                _wave = wave;
                _oscLength = Rate / freq;
                _oscSamples = 0;
                if (length == -1)
                {
                    _remainingSamples = 1;
                    _playForever = true;
                }
                else
                {
                    _remainingSamples = (Rate * length) / 1000;
                    _playForever = false;
                }
                _mixedSamples = 0;
            }
        }