hbeni / fgcom-mumble

A (flightsim) radio communication simulation based on mumble
GNU General Public License v3.0
17 stars 5 forks source link

Server: samples recording speed is deduced now #153

Closed hbeni closed 2 years ago

hbeni commented 2 years ago

Previously we assumed (hardcoded) the default recording speed of 0.02 (mumbles default). This resulted in crippled recordings for mumbles "audio per packet" values 10, 40 and 60. Now, the samples are inspected regarding their spacing when they are received from the recorder bot. Also, the FGCS file header is now written at recording closing time, so we can easily add the calculated value. The calculation records all sample delays and then takes the average of them, rounded to the nearest tenth, to smooth out jitter (also the first and last sample seem to be "0" delay most of the time)

Also, a math.average() function has been added to the sharedFunctios lib in case lua doesn't bring its own.

Fix #152

hbeni commented 2 years ago

Deployed to the test server for testing. local tests were fine, except that the playback of the "60 audio per packet" setting was choppy. 10 and 40 worked fine, tough.