Changed to only output one bar at 25 Hz

This commit is contained in:
Norbi Peti 2015-10-28 12:25:15 +01:00
parent 907c2302d3
commit c5d1c4cf08
2 changed files with 18 additions and 4 deletions

View file

@ -34,9 +34,9 @@ namespace MCAudioSpectrumAnalyzer
_hanctr = 0; _hanctr = 0;
_t = new Timer(); _t = new Timer();
_t.Tick += _t_Tick; _t.Tick += _t_Tick;
//_t.Interval = 25; //40hz refresh rate _t.Interval = 25; //40hz refresh rate
//_t.Interval = 50; //20 Hz //_t.Interval = 50; //20 Hz
_t.Interval = 400; //_t.Interval = 400;
_t.Enabled = false; _t.Enabled = false;
_l = left; _l = left;
_r = right; _r = right;

View file

@ -27,13 +27,27 @@ namespace MCAudioSpectrumAnalyzer
public void Set(List<byte> data) public void Set(List<byte> data)
{ {
if (data.Count < 16) return; if (data.Count < 16) return;
for (int i = 0; i < data.Count / 2; i++) //for (int i = 0; i < data.Count / 2; i++)
/*for (int i = 0; i < 1; i++)
if (data[i] == 0) if (data[i] == 0)
SetBar((byte)i, 1); SetBar((byte)i, 1);
else else
SetBar((byte)i, (byte)(data[i] * 2)); SetBar((byte)i, data[i * 2]);*/
byte i = 10;
if (data[i] == 0)
SetBar(0, 1);
else
SetBar(0, data[i]);
} }
/*
128.234 56 -622.622 -0.9 -21.1
Removed unnecessary block clearups
Made it catch up to 25 Hz
Fixed snow layer data value setting
*/
private UdpClient client = new UdpClient(AddressFamily.InterNetwork); private UdpClient client = new UdpClient(AddressFamily.InterNetwork);
private void SetBar(byte index, byte data) private void SetBar(byte index, byte data)
{ {