ApexLumia.RTTY.RTTY C# (CSharp) Метод

RTTY() публичный Метод

Constructor: Setup RTTY and Sound settings.
public RTTY ( double frequency = 3000, int samplerate = 42000, int baud = 300, int shift = 425, double low = 0.1, double high = 1.0, int stopbits = 2 ) : System
frequency double The frequency of the sine wave.
samplerate int The sample rate of the sound.
baud int The baud rate of the data transmission.
shift int The eventual radio frequency shift in Hz. (Not used)
low double The amplitude for a 'low' bit. 0.0->1.0
high double The amplitude for a 'high' bit. 0.0->1.0
stopbits int The number of stop bits for each byte.
Результат System
        public RTTY(double frequency = 3000, int samplerate = 42000, int baud = 300, int shift = 425, double low = 0.1, double high = 1.0, int stopbits = 2)
        {
            _sampleRate = samplerate;
            _frequency = frequency;
            _timechange = _frequency * (1.0d / _sampleRate);
            _baudrate = baud;
            _shift = shift;
            _stopBits = stopbits;
            lowVolume = low;
            highVolume = high;

            _BufferLength = (int)((1d/(double)_baudrate) * 11d * (double)_sampleRate * 2d);
            _BitLength = _BufferLength / 11 /2;
            System.Diagnostics.Debug.WriteLine(_BitLength);
            _FloatBuffer = new double[_BufferLength];
            _ByteBuffer = new byte[_BufferLength * 2];

            _dynamicSound = new DynamicSoundEffectInstance(_sampleRate, AudioChannels.Mono);
            _dynamicSound.BufferNeeded += BufferNeeded;
            _dynamicSound.Volume = 1.0f;
            SoundEffect.MasterVolume = 1.0f;
        }